开发者

PHP: Simple read data from part of a string?

From this string

{"ticker":{"hi开发者_StackOverflow中文版gh":1.747,"low":1.6,"vol":13755,"buy":1.608,"sell":1.68,"last":1.61}}

I need to get the "last" data (currently 1.61) I know there's an easy answer, but I'm not sure exactly what it is.


$values = json_decode($string, true);
echo $values['ticker']['last'];

See http://en.wikipedia.org/wiki/Json, http://php.net/json_decode.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜