Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11661

How to put each element of array into another array in same order

$
0
0

I have first array:

Array(    [0] => generala value 1    [1] => specificatii value 1)

and second array is:

   Array(    [0] => Array        (            [title] => generala title 1            [atribute_cat_id] => 1            [product_id] => 98        )    [1] => Array        (            [title] => specificatii title 1            [atribute_cat_id] => 2            [product_id] => 98        )    )

I want to get this array form:

Array(    [0] => Array        (            [title] => generala title 1            [atribute_cat_id] => 1            [product_id] => 98            [value] => generala value 1        )    [1] => Array        (            [title] => specificatii title 1            [atribute_cat_id] => 2            [product_id] => 98            [value] => specificatii value 1        ))

I tried with array_merge but this method put all elements from first array to each element from second array!Every time both arrays have same number of elements!Any ideea?Thank you!


Viewing all articles
Browse latest Browse all 11661

Trending Articles