开发者

How to access particular fields from JSON content by using php?

i want to get the val开发者_开发问答ues of different fields in Json by using php


json_decode($string) will return an object from which you can get the values you assigned.

For example:

$myObject = new MyObject();
$myObject -> att1 = 5;

$string = json_encode($myObject);

//here's how you get the value:

$myJsonDecodedObject = json_decode($string);
$value = $myJsonDecodedObject -> att1;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜