PHP 클래스 Bolt\Helpers\Arr

파일 보기 프로젝트 열기: bolt/bolt 1 사용 예제들

공개 메소드들

메소드 설명
isAssociative ( array $array ) : boolean Returns whether the given item is an associative array.
isIndexed ( array $array ) : boolean Returns whether the given item is an indexed array - zero indexed and sequential.
isIndexedArray ( array $arr ) : boolean Use {@see isIndexed} or {@see isAssociative} instead.
makeValuePairs ( array $array, string $key, string $value ) : array Make a simple array consisting of key=>value pairs, that can be used in select-boxes in forms.
mergeRecursiveDistinct ( array &$array1, array &$array2 ) : array This is the same as {@see array_replace_recursive}.
replaceRecursive ( array $array1, array $array2 ) : array Replaces values from second array into first array recursively.

메소드 상세

isAssociative() 공개 정적인 메소드

Note: Empty arrays are not.
public static isAssociative ( array $array ) : boolean
$array array
리턴 boolean

isIndexed() 공개 정적인 메소드

Note: Empty arrays are.
public static isIndexed ( array $array ) : boolean
$array array
리턴 boolean

isIndexedArray() 공개 정적인 메소드

This is the same as isIndexed but it does not check if array is zero-indexed and has sequential keys.
사용 중단: since 3.3, to be removed in 4.0.
public static isIndexedArray ( array $arr ) : boolean
$arr array
리턴 boolean True if indexed, false if associative

makeValuePairs() 공개 정적인 메소드

Make a simple array consisting of key=>value pairs, that can be used in select-boxes in forms.
public static makeValuePairs ( array $array, string $key, string $value ) : array
$array array
$key string
$value string
리턴 array

mergeRecursiveDistinct() 공개 정적인 메소드

Use that instead or the smarter {@see \replaceRecursive}.
사용 중단: since 3.3, to be removed in 4.0.
public static mergeRecursiveDistinct ( array &$array1, array &$array2 ) : array
$array1 array
$array2 array
리턴 array

replaceRecursive() 공개 정적인 메소드

This differs from {@see \array_replace_recursive} in a couple ways: - Lists (indexed arrays) from second array completely replace list in first array. - Null values from second array do not replace lists or associative arrays in first (they do still replace scalar values).
public static replaceRecursive ( array $array1, array $array2 ) : array
$array1 array
$array2 array
리턴 array The combined array