php - How to remove index from array
994
I have following array :
Array
(
[relation] => AND
[0] => Array
(
[relation] => AND
[0] => Array
(
[key] => restaurant_country
[value] => India
[compare] => ==
)
[1] => Array
(
[key] => restaurant_city
[value] => East Delhi - Noida
[compare] => ==
)
)
[1] => Array
(
[relation] => OR
[0] => Array
(
[key] => restaurant_price_min
[value] => 100
[compare] => <=
)
[1] => Array
(
[key] => restaurant_price_min
[value] => 500
[compare] => <=
)
)
)
I want to remove indexing from the above array. e.g I want the following array instead of above.
Array
(
[relation] => AND
Array
(
[relation] => AND
[0] => Array
(
[key] => restaurant_country
[value] => India
[compare] => ==
)
[1] => Array
(
[key] => restaurant_city
[value] => East Delhi - Noida
[compare] => ==
)
)
Array
(
[relation] => OR
[0] => Array
(
[key] => restaurant_price_min
[value] => 100
[compare] => <=
)
[1] => Array
(
[key] => restaurant_price_min
[value] => 500
[compare] => <=
)
)
)
I want array in this format because wordpress query run in this way.
I am not getting how to do this.
Please help me.
Answer
Solution:
The array you want is simply not possible, because each array has its key, you can't remove it.
Answer
Solution:
It seem's to be a var_export display. Maybe you are trying to show it with print_r ?
even answer of 3DR is correct, it's impossible..