- json_decode: documentation ( source)
- array_walk_recursive: documentation ( source)
<?php
$arr='[{"name":"Office","TB":[{"date":[false,true],"time":"8:00 AM"},{"days":[false,true],"time":"6:00 PM"}]}]';
$rr=json_decode($arr);
foreach ($rr[0]->TB as $key => $value) {
array_walk_recursive($value, function($k,$kk){
echo 'Key is '.$kk.' & Value is '.$k.'<br>';
});
}