“array php datar” Kode Jawaban

array php datar

$c = ["a" => ["x" => "X", "y" => "Y"], "b" => ["p" => "P", "q" => "Q"]];
print_r(array_merge(...array_values($c)));

Array
(
    [x] => X
    [y] => Y
    [p] => P
    [q] => Q
)
Defeated Dunlin

PHP Flatten Array

array_merge(...$a);
Indian Gooner

array php datar

$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
)
Defeated Dunlin

Jawaban yang mirip dengan “array php datar”

Pertanyaan yang mirip dengan “array php datar”

Lebih banyak jawaban terkait untuk “array php datar” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya