← All built-ins / array_merge()
array_merge()
array_merge(...$args): mixed
Parameters
| Name | Type | Description |
|---|---|---|
| $... | array | two or more arrays |
Return value
One merged array: later string keys overwrite, numeric keys append.
Example
$m = array_merge(["a" => 1, 0 => "x"], ["a" => 2, 0 => "y"]); echo $m["a"], count($m);
23