Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php json的转换_Php_Json - Fatal编程技术网

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;

亲爱的,我会读的,但在空闲时间,