“PHP -Array flach alle Sub -Arrays -Elemente ab” Code-Antworten

PHP -Flacharray

array_merge(...$a);
Indian Gooner

PHP -Array flach alle Sub -Arrays -Elemente ab

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

PHP -Array flach alle Sub -Arrays -Elemente ab

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

Ähnliche Antworten wie “PHP -Array flach alle Sub -Arrays -Elemente ab”

Fragen ähnlich wie “PHP -Array flach alle Sub -Arrays -Elemente ab”

Weitere verwandte Antworten zu “PHP -Array flach alle Sub -Arrays -Elemente ab” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen