php将json字符串转为数组的方法:可以利用json_decode函数来实现,如【json_decode($json, true);】。json_decode函数可以接受一个json格式的字符串并把它转换为php变量。
函数介绍:
(推荐教程:
php视频教程
)
json
_decode接受一个JSON格式的字符串并且把它转换为PHP变量 ,当该参数$assoc为TRUE时,将返回array,否则返回object。
语法格式:
立即学习
“
PHP免费学习笔记(深入)
”;
Find JSON Path Online
Easily find JSON paths within JSON objects using our intuitive Json Path Finder
下载
代码实现:
输出结果:
相关推荐:
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 )