I am trying to get the product value based on a product in the multidimensional array. please help me to get the result.
I have one multidimensional array and this array I have to convert into a single array with sort. I tried to use call_user_func_array('array_merge', $ranges); this function. After using this function get a single array.
Array
(
[0] => Array
(
[0] => Array
(
[id] => 1
[product_name] => 44 kg LPG
[value] => 0
)
[1] => Array
(
[id] => 2
[product_name] => 22 Kg LPG
[value] => 0
)
)
[1] => Array
(
[0] => Array
(
[id] => 1
[product_name] => 44 kg LPG
[value] => 2
)
[1] => Array
(
[id] => 2
[product_name] => 22 Kg LPG
[value] => 3
)
)
)
I am expecting this result.
Array
(
[0] => Array
(
[0] => 44 kg LPG
[1] => 0
[2] => 2
)
[1] => Array
(
[0] => 22 Kg LPG
[1] => 0
[2] => 3
)
)