$arr = array('name' => 'Desk');
$arr = array_add( $arr, 'price', 100);
print_r( $arr );
# Array
# (
# [name] => Desk
# [price] => 100
# )
순수 PHP
$arr = array('name' => 'Desk');
$arr['price'] = 100;
print_r($arr);
# Array
# (
# [name] => Desk
# [price] => 100
# )
$array = array_collapse([[1], ['hello', 3], [1, 2, 'hello']]);
print_r( $array );
# Array
# (
# [0] => 1
# [1] => hello
# [2] => 3
# [3] => 1
# [4] => 2
# [5] => hello
# )
$member = [
"id" => "102",
"name" => "Yonezawa Akinori",
"address" => "Naha, Okinawa"
];
list($keys, $values) = array_divide($member);
print_r( $keys );
# Array
# (
# [0] => id
# [1] => name
# [2] => address
# )
print_r( $values );
# Array
# (
# [0] => 102
# [1] => Yonezawa Akinori
# [2] => Naha, Okinawa
# )
print_r( array_dot(['foo' => ['bar' => 'baz']]) );
# Array
# (
# [foo.bar] => baz
# )
print_r( array_dot(['foo' => ['bar' => ['baz' => 'hello']]]) );
# Array
# (
# [foo.bar.baz] => hello
# )