get array of values php code example
Example 1: array values php
<?php
$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));
?>
Example 2: array flat php
$a = [[10, 20], [30, 40]];
$b = [["x" => "X", "y" => "Y"], ["p" => "P", "q" => "Q"]];
print_r(array_merge(...$a));
print_r(array_merge(...$b));
Array
(
[0] => 10
[1] => 20
[2] => 30
[3] => 40
)
Array
(
[x] => X
[y] => Y
[p] => P
[q] => Q
)