0

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?

4

1 回答 1

1

如果你的第一个数组是

$first =  array('1'=>1,'2'=>2)

第二个是

$second =  array()

然后只需将其添加为

$first[] = $second

如果第二个是

$second[3] = array();

然后你想要array_merge

$first = array_merge($first,$second)

该链接左侧有各种数组函数,非常方便。

于 2013-08-28T20:32:00.083 回答