我搜索了很多,我发现了很少的方法来查找我的JSON数组的长度。我曾尝试:查找json数组中的对象数
count
json.length
但这些返回1,而不是实际的长度。我想用PHP显示它。
我的JSON是:
$huge = '[{"location":[{"building":["Default Building"],"name":"Default Location"}],"name":"Default Organization"},{"location":[{"building":["test_loc1_building1","test_loc1_building2"],"name":"test location1"},{"building":["test_loc2_building2"],"name":"test location2"}],"name":"test Organization"}]';
我如何才能找到我的JSON数组对象的数量?
JSON是一种序列化格式,那么对它进行反序列化和检查呢? – 2013-04-08 06:24:09
在这里你有另一个解决方案,而不使用json_decode。 HTTP://计算器。com/questions/28772904/convert-json-string-to-array-without-json-decode – 2016-03-10 09:19:11
在这里你有另一个解决方案,而不使用json_decode:http://stackoverflow.com/questions/28772904/convert-json-string-to -array-without-json-decode – 2016-03-10 09:20:29