我使用这个代码来显示用户的所有影片在我的网站:的Youtube获取用户的视频的ID在API V3 PHP
<?php
$xml = simplexml_load_file('http://gdata.youtube.com/feeds/api/users/XXXXXXX/uploads');
$server_time = $xml->updated;
$return = array();
foreach ($xml->entry as $video) {
$vid = array();
$vid['id'] = substr($video->id,42);
$vid['title'] = $video->title;
array_push($return, $vid);
}
?>
<h2>Video Gallery</h2>
<?php
foreach($return as $video) {
?>
<div class="col-md-4">
<div style="height: auto;" class="featured-box featured-box-secundary">
<div class="box-content clearfix">
<h4><?= $video['title'] ?></h4>
<iframe width="270" height="203" src="https://www.youtube.com/embed/<?=$video['id']?>?rel=0&showinfo=0" allowfullscreen></iframe>
</div></div></div>
<?php
}
?>
但我收到了已过时的通知。我可以如何使用API v3将$ vid ['id']和$ vid ['title']放入HTML中?
请告诉我的'$返回输出'?你得到了哪些不赞成的通知? – Alex
该通知是youtube与info中的额外视频。 –