<?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);
?>
相关文章
- 10-29json_encode()与json_decode()的区别
- 10-29Cannot use object of type stdClass as array 问题解决 json_decode 转换
- 10-29json_decode返回NULL
- 10-29Json处理函数json_encode json_decode
- 10-29解决php中json_decode的异常JSON_ERROR_CTRL_CHAR (json_last_error = 3)
- 10-29json_decode 转数组
- 10-29HP数组转JSON函数json_encode和JSON转数组json_decode函数的使用方法
- 10-29json_encode和json_decode
- 10-29PHP中json_encode与json_decode
- 10-29php中json_decode()和json_encode()