【发布时间】:2013-08-10 07:43:51
【问题描述】:
我无法解析下面给出的这个 json 字符串,有人建议一些好的选择:
$json_string = '{{"name":"ff","phone":344543},{"name":"sdf","phone":344543}, {"name":"sfsd","phone":344543}}';
i have tried json_decode($json_string); but not working. I need to parse this string and retrieve the coontants as normal array. please help.
谢谢
【问题讨论】:
-
您的字符串不是有效的 JSON。
-
顺便说一句,请改用
json_decode($json_string, TRUE);。 -
它正在工作,我可以知道第二个参数 true 是什么意思吗?
-
@VeNaToR 它返回一个
array而不是stdClass对象。
标签: php codeigniter json