I have an array in the format:
array (
[0] => array (
[0] => array (
[id] => 19
[Type] => sng
[TouristPrice] => 2500
[ExtraBeds] => 1500
[ChildPrice] => 1000
)
)
)
And I’d like to convert it to:
array (
[0] => array (
[id] => 19
[Type] => sng
[TouristPrice] => 2500
[ExtraBeds] => 1500
[ChildPrice] => 1000
)
)
How might I go about doing this?
One thing you can do is, walking through the array and putting the first option this way, in case, all the array items will be of the same kind, having only one level deep. It is just like moving a folder inside a folder, to the parent folder:
Tried this code:
Got this output: