Php json的转换
嗨,伙计们,我正在努力在我的网站上显示天气更新。 为此,我发送了一些代码,这些代码返回给我一些东西,如下所示Php json的转换,php,json,Php,Json,嗨,伙计们,我正在努力在我的网站上显示天气更新。 为此,我发送了一些代码,这些代码返回给我一些东西,如下所示 stdClass Object ( [data] => stdClass Object ( [current_condition] => Array ( [0] => stdClass Object (
stdClass Object
(
[data] => stdClass Object
(
[current_condition] => Array
(
[0] => stdClass Object
(
[temp_C] => 26
[temp_F] => 79
)
)
)
)
我想获取位于[o]=>stdClass对象下方的temp_C
为了这个目的,我使用了这样的支架
//$returning is variable have all the json in it
$celcius = $returning->data->current_condition->0->temp_c;
请指导我如何获取temp_C,,,我目前正在使用php。
感谢所有人当前的情况是一个数组
$celcius = $returning->data->current_condition[0]->temp_c;
亲爱的,我会读的,但在空闲时间,