PHP 클래스 Kraken\Util\Support\ArraySupport

파일 보기 프로젝트 열기: kraken-php/framework 1 사용 예제들

공개 메소드들

메소드 설명
exists ( array $array, string $key ) : boolean Check if given key exists in array with dot notation support.
expand ( $array ) : array Expand flattened array into a multi-dimensional one.
flatten ( array $array ) : array Flatten a multi-dimensional array into a single level using dot notation.
get ( array $array, string $key, mixed $default = null ) : mixed Return the value stored under given key in the array with dot notation support.
isEmpty ( array $array ) : boolean Check if given array is empty.
merge ( array[] $arrays ) : array Merge several arrays, preserving dot notation.
normalizeKey ( string $key ) : string Normalize key to dot notation valid format.
remove ( &$array, string $key ) : boolean Remove the value stored under given key from the array with dot notation support.
replace ( array[] $arrays ) : array Merge several arrays.
set ( &$array, string $key, mixed $value ) : array Set the value for given key in the array with dot notation support.

보호된 메소드들

메소드 설명
flattenRecursive ( array &$recursion, string $prefix ) : array Flatten a single recursion of array.

메소드 상세

exists() 공개 정적인 메소드

Check if given key exists in array with dot notation support.
public static exists ( array $array, string $key ) : boolean
$array array
$key string
리턴 boolean

expand() 공개 정적인 메소드

Expand flattened array into a multi-dimensional one.
public static expand ( $array ) : array
$array
리턴 array

flatten() 공개 정적인 메소드

Flatten a multi-dimensional array into a single level using dot notation.
public static flatten ( array $array ) : array
$array array
리턴 array

flattenRecursive() 보호된 정적인 메소드

Flatten a single recursion of array.
protected static flattenRecursive ( array &$recursion, string $prefix ) : array
$recursion array
$prefix string
리턴 array

get() 공개 정적인 메소드

Return the value stored under given key in the array with dot notation support.
public static get ( array $array, string $key, mixed $default = null ) : mixed
$array array
$key string
$default mixed
리턴 mixed

isEmpty() 공개 정적인 메소드

Check if given array is empty.
public static isEmpty ( array $array ) : boolean
$array array
리턴 boolean

merge() 공개 정적인 메소드

Merge several arrays, preserving dot notation.
public static merge ( array[] $arrays ) : array
$arrays array[]
리턴 array

normalizeKey() 공개 정적인 메소드

Normalize key to dot notation valid format.
public static normalizeKey ( string $key ) : string
$key string
리턴 string

remove() 공개 정적인 메소드

Remove the value stored under given key from the array with dot notation support.
public static remove ( &$array, string $key ) : boolean
$key string
리턴 boolean

replace() 공개 정적인 메소드

Merge several arrays.
public static replace ( array[] $arrays ) : array
$arrays array[]
리턴 array

set() 공개 정적인 메소드

Set the value for given key in the array with dot notation support.
public static set ( &$array, string $key, mixed $value ) : array
$key string
$value mixed
리턴 array