ArraySimple class
Framework\Helpers\ArraySimple
Class ArraySimple.
Contains methods to work with PHP arrays using "simple keys" (strings with
square brackets).
Simple key format example: `parent[child1][child2]`.
`user[country][state]` gets 'rs' in
`array('user' => ['country' => ['state' => 'rs']])`
Defined in libraries/helpers/src/ArraySimple.php
Methods #
- convert()
- Converts an array to an associative array with simple keys.
- files()
- Get $_FILES in a re-organized way.
- keys()
- Gets the keys of an array in the simple keys format.
- revert()
- Reverts an associative array of simple keys to an native array.
- value()
- Gets the value of an array item through a simple key.
- addChild()
- -
- extractKeys()
- -
- filesWalker()
- -
- getChildKey()
- -
- getKeys()
- -
- getParentKey()
- -
convert()
Converts an array to an associative array with simple keys.
- array $array - Array to be converted
files()
Get $_FILES in a re-organized way.
NOTE: Do not use file input names as `name`, `type`, `tmp_name`, `error`,
`full_path` and `size` to avoid overwrite of arrays.
- ?array $files
keys()
Gets the keys of an array in the simple keys format.
- array $array - The array to get the simple keys
revert()
Reverts an associative array of simple keys to an native array.
- array $arraySimple - An array with simple keys
value()
Gets the value of an array item through a simple key.
- string $simpleKey - A string in the simple key format
- array $array - The array to search in
addChild()
- array $parent
- array $childs
- mixed $value
extractKeys()
- string $simpleKey
filesWalker()
- array $array
- string $infoKey
getChildKey()
- string $key
getKeys()
- array $array
- string $childKey
getParentKey()
- string $key