This repository was archived by the owner on Dec 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
array_of_array.inc
Tadatoshi Tokutake edited this page May 30, 2015
·
13 revisions
- aoa_set
- aoa_unset
- aoa_collect
- aoa_transpose
- aoa_values
- aoa_sum
- aoa_map
- aoa_reduce
- aoa_filter
- aoa_sort
- aoa_associate
array aoa_set(array $aoa, array $keys, mixed $value)
- Return the array set
$valueatkey1 => [key2 => ...]. - Example:
var_dump(aoa_set([], ['VAIO Z', 'spec', 'cpu'], 'Core i7-5557U 3.10 GHz'));
// => [
// 'VAIO Z' => [
// 'spec' => [
// 'cpu' => 'Core i7-5557U 3.10 GHz',
// ]
// ]
// ]array aoa_unset(array $aoa, array $keys)
- Return the array unset the value at
key1 => [key2 => ...]. - Example:
$array = ['db' => ['primary' => 0, 'secondary' => 1]];
var_dump(aoa_unset($array, ['test', 'secondary'])); // => ['db' => ['primary' => 0]]array aoa_collect(array $aoa, mixed $key)
array aoa_transpose(array $matrix)
array aoa_values(array $aoa, mixed $key)
mixed aoa_sum(array $aoa, mixed $key)
array aoa_map(array $aoa, mixed $key, Closure $closure)
mixed aoa_reduce(array $aoa, mixed $key, Closure $closure, mixed $initial)
array aoa_filter(array $aoa, mixed $key, Closure $closure)
array aoa_sort(array $aoa, mixed $key, int $order = SORT_ASC, int $option = SORT_REGULAR)
array aoa_associate(array $aoa, mixed $key)
Welcome any issure or pull request!
Please contact me by mail to tadatoshi.tokutake@gmail.com if you have some questions!