摘要:今天发现一个申请的json解析情况,记录一下
$str1 = '[
{
"englishname":"William Chen",
"class":"01.70.04."
},
{
"englishname":"Zoe Bai",
"class":"01.50.08.04."
},
{
"englishname":"Zoe Zhu",
"class":"01.07.06."
}
]';
$str = "[
{
'text1':'Parent 2',
'text2':'#parent2'
},
{
'text1':'Parent 3',
'text2':'#parent3'
},
{
'text1':'Parent 4',
'text2':'#parent4'
},
{
'text1':'Parent 5',
'text2':'#parent5'
}
]";
json数据需要使用双引号包裹,单引号会发生这个问题。