输出数组对象

时间:2014-05-20 12:26:14

标签: php arrays

我正在尝试输出[id]中的值但是我不确定如何访问“视频对象”以获取[id]值。

我尝试了以下内容,看看我是否得到任何数据响应都没有成功。

print_r($arr[0]->video);

这是整个阵列。

Array ( 
    [0] =>Video Object ( 
        [version] => 1.0 
        [id] => 26696 
        [title] => vztest 
        [description] => 
        [createdAt] => 2009-06-08T14:27:45+00:00 
        [url] => http://view.vzaar.com/26696/video 
        [thumbnail] => http://view.vzaar.com/26696/thumb 
        [playCount] => 0 
        [duration] => 91.33 
        [width] => 320 
        [height] => 200 
        [framegrabUrl] => http://vzaar.com/videos/26696.frame 
        [user] => User Object ( 
            [version] => 
            [authorName] => vzaar 
            [authorId] => 
            [authorUrl] => http://app.vzaar.com/users/vzaar 
            [authorAccount] => 34 
            [createdAt] => 
            [videoCount] => 114 
            [playCount] => 
         )
    ) 

提前致谢

1 个答案:

答案 0 :(得分:0)

这应该适合你 -

$videoObjectID = $array[0]->id;
相关问题