I hope somebody can help me, I need to order array No.1 based on the position of array no.2 , using the array1->id
to array2->products_id
Array No.1
{"products":[{"id": 9847760515,"title":"Some Dress"},{"id": 10769647619,"title":"Shirt"}]}
Array No.2 where the order is: (position":x)
{"collects":[{"id":38447047939,"product_id":10769647619,"position":1,"sort_value":"0000000001"},{"id":25425594499,"product_id":9847760515,"position":3,"sort_value":"0000000003"}]}
foreach ($sorted_array as $product) {
echo $product['name'];
}
Appreciate any help