<?php
$video_ID = "D8Mlj39Mpyo";
$jsonURL = file_get_contents("https://www.googleapis.com/youtube/v3/videos?id={$video_ID}&key=YOUR_KEY_HERE&part=statistics");
$json = json_decode($jsonURL);
$views = $json->{'items'}[0]->{'statistics'}->{'viewCount'};
echo number_format($views,0,'.',',');
echo json_encode($json);
?>
$video_ID = "D8Mlj39Mpyo";
$jsonURL = file_get_contents("https://www.googleapis.com/youtube/v3/videos?id={$video_ID}&key=YOUR_KEY_HERE&part=statistics");
$json = json_decode($jsonURL);
$views = $json->{'items'}[0]->{'statistics'}->{'viewCount'};
echo number_format($views,0,'.',',');
echo json_encode($json);
?>
thats a cool way to show youtube views and other statistics thanks
ReplyDeletehi i am php and wordpress developer my site is http://hindugeek.com I also do programming in php
ReplyDeleteThe Blog is very informative. This is very Helpful. Thanks for sharing.
ReplyDeletePHP Training in Gurgaon
It is a proficient article that you simply have shared here. I got some unique and valuable information from your article. Thankful to you for sharing this text here. php course in delhi
ReplyDeleteThe details you've shared here areIt’sextremely instructive because it contains some best knowledge, which is extremely helpful. Thanks for posting it. php course in delhi
ReplyDeleteNice post, PHP has collection of errors so I am specifying some errors below.
ReplyDeletePHP Fatal error: Composer detected issues in your platform