PHP 클래스 WPDKArray

## Overview The WPDKArray class is an helper that provides a lot of static method for make easy and fast to works with array.
저자: =undo= ([email protected])
상속: extends WPDKObject
파일 보기 프로젝트 열기: wpxtreme/wpdk 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$__version string Override version

공개 메소드들

메소드 설명
append ( array $array, array &$dest ) : array Append an array or key value pairs array in a destination array. The $dest array is changed.
arrayExtractByKey ( array $sourceArray, array $arrayKeys ) : array Return a new key value pairs array with element that match with key of the second array. In other words, if the key of $array_extract is found in keys of $array_key, then that element is catch, else is ignored.
arrayMatch ( array $array_keys, array $array_match ) : array Return a new key value pairs array with element that match with key of the second array. In other words, if the key of $array_match is found in $array_keys, then that element is catch, else is ignored.
arrayMatchWithKeys ( array $array, array $array_match ) : array This is an alias of WPDKArray::arrayMatch() for key value pairs array
arrayMatchWithValues ( array $array, array $array_match ) : array This is an alias of WPDKArray::arrayMatch() for key value pairs array
arrayToObject ( array $array ) : object Convert an array into a stdClass()
arrayWithKey ( array $array_key, array $array_extract ) : array Return a new key value pairs array with element that match with key of the second array. In other words, if the key of $array_extract is found in keys of $array_key, then that element is catch, else is ignored.
fit ( array $source, array $defaults ) : array Return a merged array from default and source. If source array has some key miss in defaults array, an unset on that key is performed.
httpBuildQuery ( array $formdata, null $numeric_prefix = null, null $arg_separator = null ) : string Simulates the behavior of http_build_query() in the previous versions of php 5
insert ( array &$arr, array $new, integer $index ) : array Insert an array or key value pairs array in a second array to a specify index
insertKeyValuePairs ( array $arr, string $key, mixed $val, integer $index ) : array Insert a key => value into a second array to a specify index
objectToArray ( object $object ) : array Convert a object to an array
prepend ( array $array, array &$dest ) : array Prepend an array or key value pairs array in a destination array. The $dest array is changed.
stripKeys ( array $source, array $keeplist ) : mixed Return a key pairs array start from source without the keys not present in keeplist
wrapArray ( array $array ) : array Warp each element of an array with an array

메소드 상세

append() 공개 정적인 메소드

Append an array or key value pairs array in a destination array. The $dest array is changed.
public static append ( array $array, array &$dest ) : array
$array array Source array to prepend
$dest array Reference to destination array
리턴 array

arrayExtractByKey() 공개 정적인 메소드

Return a new key value pairs array with element that match with key of the second array. In other words, if the key of $array_extract is found in keys of $array_key, then that element is catch, else is ignored.
사용 중단: since 1.4.8
public static arrayExtractByKey ( array $sourceArray, array $arrayKeys ) : array
$sourceArray array A source key value pairs array that have to match with a specific key
$arrayKeys array A key value pairs array with the keys to match
리턴 array

arrayMatch() 공개 정적인 메소드

Return a new key value pairs array with element that match with key of the second array. In other words, if the key of $array_match is found in $array_keys, then that element is catch, else is ignored.
부터: 1.4.8
public static arrayMatch ( array $array_keys, array $array_match ) : array
$array_keys array An array with the keys for match
$array_match array A source key value pairs array that have to match with a specific key
리턴 array

arrayMatchWithKeys() 공개 정적인 메소드

This is an alias of WPDKArray::arrayMatch() for key value pairs array
부터: 1.4.8
public static arrayMatchWithKeys ( array $array, array $array_match ) : array
$array array A key vaues pairs array where the values are used as key for match
$array_match array A source key value pairs array that have to match with a specific key
리턴 array

arrayMatchWithValues() 공개 정적인 메소드

This is an alias of WPDKArray::arrayMatch() for key value pairs array
부터: 1.4.8
public static arrayMatchWithValues ( array $array, array $array_match ) : array
$array array A key vaues pairs array where the values are used as key for match
$array_match array A source key value pairs array that have to match with a specific key
리턴 array

arrayToObject() 공개 정적인 메소드

Convert an array into a stdClass()
public static arrayToObject ( array $array ) : object
$array array The array we want to convert
리턴 object

arrayWithKey() 공개 정적인 메소드

Return a new key value pairs array with element that match with key of the second array. In other words, if the key of $array_extract is found in keys of $array_key, then that element is catch, else is ignored.
사용 중단: since 1.4.8
public static arrayWithKey ( array $array_key, array $array_extract ) : array
$array_key array A key value pairs array with the keys to match
$array_extract array A source key value pairs array that have to match with a specific key
리턴 array

fit() 공개 정적인 메소드

Return a merged array from default and source. If source array has some key miss in defaults array, an unset on that key is performed.
부터: 1.3.0
public static fit ( array $source, array $defaults ) : array
$source array A key pairs array
$defaults array A key pairs array with default keys and values
리턴 array

httpBuildQuery() 공개 정적인 메소드

Simulates the behavior of http_build_query() in the previous versions of php 5
public static httpBuildQuery ( array $formdata, null $numeric_prefix = null, null $arg_separator = null ) : string
$formdata array Array $key => $value
$numeric_prefix null See http_build_query() documentation
$arg_separator null See http_build_query() documentation
리턴 string

insert() 공개 정적인 메소드

Insert an array or key value pairs array in a second array to a specify index
public static insert ( array &$arr, array $new, integer $index ) : array
$arr array Source array
$new array New array
$index integer Optional. Index zero base
리턴 array

insertKeyValuePairs() 공개 정적인 메소드

Insert a key => value into a second array to a specify index
public static insertKeyValuePairs ( array $arr, string $key, mixed $val, integer $index ) : array
$arr array Source array
$key string Key
$val mixed Value
$index integer Optional. Index zero base
리턴 array

objectToArray() 공개 정적인 메소드

Convert a object to an array
public static objectToArray ( object $object ) : array
$object object The object we want to convert
리턴 array

prepend() 공개 정적인 메소드

Prepend an array or key value pairs array in a destination array. The $dest array is changed.
public static prepend ( array $array, array &$dest ) : array
$array array Source array to prepend
$dest array Reference to destination array
리턴 array

stripKeys() 공개 정적인 메소드

Return a key pairs array start from source without the keys not present in keeplist
부터: 1.3.0
public static stripKeys ( array $source, array $keeplist ) : mixed
$source array Source key pairs array
$keeplist array Key pairs array with the list of key to keep
리턴 mixed

wrapArray() 공개 정적인 메소드

Warp each element of an array with an array
public static wrapArray ( array $array ) : array
$array array An array
리턴 array

프로퍼티 상세

$__version 공개적으로 프로퍼티

Override version
public string $__version
리턴 string