https://gdata.youtube.com/feeds/api/playlists/8BCDD04DE8F771B2?v=2&alt=json
<?php
$youtube_view_count = json_decode(file_get_contents('https://gdata.youtube.com/feeds/api/playlists/PL7FC6D85A4AE63E21'))->entry->{'yt:statistics'}->viewCount;
$elem = new SimpleXMLElement($youtube_view_count);
$a = viewCount;
foreach ($elem as $a){
printf($a->count());
}
?>
$playlist = file_get_contents('https://gdata.youtube.com/feeds/api/playlists/8BCDD04DE8F771B2?v=2&alt=json');
$playlist = str_replace('yt$statistics', 'yt_statistics', $playlist);
$playlist = json_decode($playlist);
$entries = $playlist->feed->entry;
$views = 0;
foreach ((array)$entries as $entry) {
$views += $entry->yt_statistics->viewCount;
}
echo $views;