I am trying to remove an object from JSON array but is having a few issues. here is what I have right now.
{
"value":"In-plop",
"no_delete":true,
"disabled":null,
"resource":"e48f8f",
"email":"1"
}
]';
foreach ($status as $key => $value) {
if (in_array('Dispatched', $value)) {
unset($status[$key]);
}
}
$status = json_encode($status);
echo $status;
I am trying to remove this entire object. I know my current code will only remove the value of the single object, but this is where I am stuck. The problem is that the object position is not static, it can be anywhere in the array. The only thing that is static is value:Dispatched. Any suggestions?
{
"value":"opuy",
"no_delete":true,
"disabled":null,
"resource":"a382d1",
"email":"1"
},