json能自动补充代码么?望求解 >(*_*)<
$mu=array(1=>"value","value1","value3");
$ke=json_encode($mu);
echo $ke;
输出结果:
{"1":"value","2":"value1","3":"value3"}
**************************************************************************************************
$mu=array(0=>"value","value1","value3");
$ke=json_encode($mu);
echo $ke;
输出结果:
["value","value1","value3"]
**************************************************************************************************
$mu=array(a=>"value","value1","value3");
$ke=json_encode($mu);
echo $ke;
输出结果:
{"a":"value","0":"value1","1":"value3"}