Basically the json output is this -output is from php.
[{"attr":{"id":"node_2","rel":"default"},"data":"C:","state":"closed"},{"attr":{"id":"node_3","rel":"drive"},"data":"D:","state":"closed"}]
so because rel is equal to default
{"attr":{"id":"node_2","rel":"default"},"data":"C:","state":"closed"}
I need to remove this from the array.
I have thought of maybe using
foreach($arr as $key => &$item) {
if ($value['rel'] == 'default'{
unset($arr[$key]);
This however, wont work for some reason. I have no idea if my method is the best way, or whether there is a better way to achieve this. I also need to decode and encode it.