我是一个php新手,现在在自己写一个简单的借口,在接口文件中返回一个json,要怎么在另外一个文件中获取json里面的值,这个是我用curl获取到的json{"key":"testAction","account":"root","weight":"200kg"}然后我要怎么获取里面的值?比方说单单获取key或者account?我用$jsContent.key和$jsContent["key"]都不行,要怎么处理这样子的数据,也试过json_decode,也是不行
How does php get the value in json - PHP Chinese website Q&A - How does php get the value in json - PHP Chinese website Q&A
Take a look around and learn.
json_decode($data, TRUE); 第二个参数加上TRUE会把json数据转成PHP数组
How does php get the value in json - PHP Chinese website Q&A - How does php get the value in json - PHP Chinese website Q&A
Take a look around and learn.
json_decode($data, TRUE); 第二个参数加上TRUE会把json数据转成PHP数组