我现在有一个变量$返回包含JSON编码的数据,打印出的:访问特定的JSON值
({0:{data:[[0, null], [1, null], [2, null], [3, null], [4, null], [5, null], [6, null], [7, null], [8, null], [9, null], [10, null], [11, null], [12, null], [13, null], [14, null], [15, null], [16, null], [17, null], [18, null], [19, null], [20, null], [21, null], [22, null], [23, null]], label:null, count:null},
等(太多复制和粘贴)。基本上我想要做的是找出数据的值是否为[0,null]为空,然后根据结果创建一个if else语句。如果它为空,我需要显示一条消息“无可用数据”,但如果它包含一个值,我需要显示该值。
有人可以解释我会如何访问特定的值吗?
感谢所有帮助
+1,json_decode是关键的一步 – SW4