0 => 'foo',
1 => false,
2 => -1,
3 => null...$val)
{
unset($entry[$k]);
}
}
print_r($entry);*/
echo "以下是json数据的操作";
//删除json...中空的json
$json_string= '[{"id":"1","name":"-1","age":"27","subject":false},{"id":"2","name":"liwen...","age":null,"subject":""}]';
$data = json_decode($json_string,true);//把json转换成数组
foreach($data as...= json_encode($data);//在转化成json,
}
var_dump($json_strings);
json删掉空的效果:
删掉空的数组效果