php json_decode函数
2015-09-02 22:50
786 查看
json_decode — 对 JSON 格式的字符串进行编码
mixed json_decode ( string json[,booljson [, bool assoc ] )
返回一个对象,如果assoc参数选项为true,将会返回一个关联数组。
mixed json_decode ( string json[,booljson [, bool assoc ] )
返回一个对象,如果assoc参数选项为true,将会返回一个关联数组。
$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; var_dump(json_decode($json)); var_dump(json_decode($json, true));
输出结果: object(stdClass)#1 (5) { ["a"] => int(1) ["b"] => int(2) ["c"] => int(3) ["d"] => int(4) ["e"] => int(5) } array(5) { ["a"] => int(1) ["b"] => int(2) ["c"] => int(3) ["d"] => int(4) ["e"] => int(5) }
相关文章推荐
- PHP大小写是否敏感问题的汇总
- php时间函数的学习
- PHP大小写是否敏感问题的汇总
- php分页类
- php判断文件夹是否存在,不存在则创建
- 格式化输出字符串之Format、IFormattable、IFormatProvider、ICustomFormatter
- PHP的SOAP工具包--nusoap
- php-fpm 启动参数及重要配置详解
- 烂泥:vsftpd单用户多目录配置
- 烂泥:vsftpd单用户多目录配置
- 烂泥:ubuntu下vsftpd虚拟用户配置
- 烂泥:ubuntu下vsftpd虚拟用户配置
- [转]php返回json数据中文显示的问题
- php获取在线xml的数据
- php学习
- phpcmsv9取消会员登录验证码
- ftp上传下载文件到服务器
- 一起来做属于自己的PHP项目
- thinkphp 数据库查询是id大于等于
- 搜索框 phpcms 简单