I have to arrays. Here is first:
array(3)
{
[0]=> string(10) "image1.jpg"
[1]=> string(10) "image2.jpg"
[2]=> string(10) "image3.jpg"
}
And second one:
array(3)
{
[0]=> object(stdClass)#22 (4)
{
["id"]=> string(1) "1"
["name"]=> string(6) "Name 1"
["file"]=> string(15) "f1335421531.zip"
["desc"]=> string(6) " "
}
[1]=> object(stdClass)#23 (4)
{
["id"]=> string(1) "2"
["name"]=> string(6) "Name 2"
["file"]=> string(15) "f1335421552.zip"
["desc"]=> string(6) " "
}
[2]=> object(stdClass)#24 (4)
{
["id"]=> string(1) "3"
["name"]=> string(6) "Name 3"
["file"]=> string(15) "f1335421588.zip"
["desc"]=> string(6) " "
}
}
How can I merge these arrays into one with following items:
[0]=> object(stdClass)#22 (4)
{
["id"]=> string(1) "1"
["name"]=> string(6) "Name 1"
["file"]=> string(15) "f1335421531.zip"
["desc"]=> string(6) " "
["img"]=> string(10) "image1.jpg"
}
etc.
Is there any function to do it or maybe I need to write loop?
1 Answer