我想处理可能如下所示的 JSON 数据结构:
$json = {"1":"some content here","hello":"world"};
我使用 PHP 中的 json_decode 方法将其转换为数组:
$myArray = (array)json_decode($json);
我现在的问题是
unset($myArray["1"]);
什么都不做。
你能给我什么建议吗?我也试过:
unset($myArray[(String)"1"]);
谢谢!
编辑:我的问题有错误,感谢评论中的更正!