json_decode

json_decode

 <?php 

     $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; 

     //json_decode 将json格式的字符串转成php数组或者对象
$object = json_decode($json); //转成php对象(stdClass Object)
echo $object->a.'**';
echo $object->b.'**';
echo $object->c.'**';
echo $object->d.'**';
echo $object->e; $arr = json_decode($json,true); //转成php数组
echo "<pre/ >";
print_r($arr);
?>
上一篇:pycharm 安装和首次使用


下一篇:iOS开发者必备的10款工具