函数介绍:
(推荐教程:php视频教程)
json_decode接受一个JSON格式的字符串并且把它转换为PHP变量 ,当该参数$assoc为TRUE时,将返回array,否则返回object。
语法格式:
立即学习“PHP免费学习笔记(深入)”;
json_decode(string $json[,bool $assoc = false[,int $depth = 512[,int $options = 0]]])
代码实现:
输出结果:
stdClass Object ( [a] => php [b] => mysql [c] => 3 ) Array ( [a] => php [b] => mysql [c] => 3 )
相关推荐:php培训

