Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

array_of_array.inc

Tadatoshi Tokutake edited this page May 30, 2015 · 13 revisions

Index

Details

aoa_set

array aoa_set(array $aoa, array $keys, mixed $value)

  • Return the array set $value at key1 => [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',
//          ]
//       ]
//    ]

aoa_unset

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]]

aoa_collect

array aoa_collect(array $aoa, mixed $key)

aoa_transpose

array aoa_transpose(array $matrix)

aoa_values

array aoa_values(array $aoa, mixed $key)

aoa_sum

mixed aoa_sum(array $aoa, mixed $key)

aoa_map

array aoa_map(array $aoa, mixed $key, Closure $closure)

aoa_reduce

mixed aoa_reduce(array $aoa, mixed $key, Closure $closure, mixed $initial)

aoa_filter

array aoa_filter(array $aoa, mixed $key, Closure $closure)

aoa_sort

array aoa_sort(array $aoa, mixed $key, int $order = SORT_ASC, int $option = SORT_REGULAR)

aoa_associate

array aoa_associate(array $aoa, mixed $key)

Clone this wiki locally