I've got an multidimensional array.
{
"id": "13",
"name": "Example",
"location_name": "NY",
"phone": [
{
"number": "0617357707"
}
],
"facilities": {
"data": [
{
"name": "AC"
},
{
"name": "Wi-Fi"
}
]
}
}
The problem I want to solve is at "facilities". Inside facilities, there is a data object. How can I remove the data without removing the content "data"?
Expected result:
{
"id": "13",
"name": "Example",
"location_name": "NY",
"phone": [
{
"number": "0617357707"
}
],
"facilities": [
{
"name": "AC"
},
{
"name": "Wi-Fi"
}
]
}
I've tried using array_walk or flatten but not getting it right.
facilitiesrelevant to your question? Is theresultsparts of an object or an array?