I have 2 arrays :
$a and $b
i want to merge this arrays to $res
here is my code:
$a = array("
[0] => Array
(
[0] => 45677
[ID] => 45677
[1] => 10
[post_author] => 10
[2] => 2014-02-26 19:05:59
[post_date] => 2014-02-26 19:05:59
[3] => 2014-02-26 14:35:59
[post_date_gmt] => 2014-02-26 14:35:59
)");
$b= array("
[0] => Array
(
[first_image] => http://gogole.com/a.jpg
)");
$res = array_merge($a,$b);
OUTPUT :
Array
(
[0] =>
[0] => Array
(
[0] => 45677
[ID] => 45677
[1] => 10
[post_author] => 10
[2] => 2014-02-26 19:05:59
[post_date] => 2014-02-26 19:05:59
[3] => 2014-02-26 14:35:59
[post_date_gmt] => 2014-02-26 14:35:59
)
[1] =>
[0] => Array
(
[first_image] => http://gogole.com/a.jpg
)
)
it should be something like this :
Array
(
[0] => Array
(
[0] => 45677
[ID] => 45677
[1] => 10
[post_author] => 10
[2] => 2014-02-26 19:05:59
[post_date] => 2014-02-26 19:05:59
[3] => 2014-02-26 14:35:59
[post_date_gmt] => 2014-02-26 14:35:59
[first_image] => http://gogole.com/a.jpg
)
)
)
what is problem ?
and how can i fix it ?
array_merge()but you wantarray_push()$res = array_merge($a[0],$b[0]);not be a correct option, just wondering...?