开发者

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

开发者 https://www.devze.com 2023-01-27 11:32 出处:网络
i want to get the val开发者_开发问答ues of different fields in Json by using phpjson_decode($string) will return an object from which you can get the values you assigned.

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

精彩评论

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

关注公众号