The comments for each YouTube video can be retrieved in several ways. To retrieve the comments for the video with the ID 'abc123813abc', use the following code:
Example 449. Retrieving a feed of video comments from a video ID
<?php
$yt = new Zend_Gdata_YouTube();
$commentFeed = $yt->getVideoCommentFeed('abc123813abc');
foreach ($commentFeed as $commentEntry) {
echo $commentEntry->title->text . "\n";
echo $commentEntry->content->text . "\n\n\n";
}
Comments can also be retrieved for a video if you have a copy of the Zend_Gdata_YouTube_VideoEntry object:
Example 450. Retrieving a Feed of Video Comments from a Zend_Gdata_YouTube_VideoEntry
<?php
$yt = new Zend_Gdata_YouTube();
$videoEntry = $yt->getVideoEntry('abc123813abc');
// we don't know the video ID in this example, but we do have the URL
$commentFeed = $yt->getVideoCommentFeed(null,
$videoEntry->comments->href);




