Skip to content

Instantly share code, notes, and snippets.

@computingfreak
Created October 4, 2019 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save computingfreak/629f74a533f3353a8a4d0a958ec1ba1e to your computer and use it in GitHub Desktop.
Save computingfreak/629f74a533f3353a8a4d0a958ec1ba1e to your computer and use it in GitHub Desktop.
<?php
$a['b']=[];
$a['b']['x']="y";
$a['c']=[];
$a['c']['y']="z";
$b=array_merge($a['b'],$a['c']);
print_r($b);
var_dump($b);
/*
Array
(
[x] => y
[y] => z
)
array(2) {
["x"]=>
string(1) "y"
["y"]=>
string(1) "z"
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment