i have a problem. I have two arrays and i need to put one into other like this:
array('1'=>1,'2'=>2,'3'=>array());
Can somebody advise how to solve it?
i have a problem. I have two arrays and i need to put one into other like this:
array('1'=>1,'2'=>2,'3'=>array());
Can somebody advise how to solve it?
If your first array is
$first = array('1'=>1,'2'=>2)
And the second is
$second = array()
Then just add it in as
$first[] = $second
If the second is
$second[3] = array();
Then you want array_merge
$first = array_merge($first,$second)
There are all sorts of array functions on the left in that link, which come in very handy.