Thursday, September 20, 2012
6:32 PM

Solution to getVideoRatingInfo() returning array in PHP youtube API

If you are using PHP for Youtube API then you may face problem of getVideoRatingInfo() returning array

Problem
echo "Rating: ".$videoEntry->getVideoRatingInfo();
output: Array

Solution
$a = array();
$a = $videoEntry->getVideoRatingInfo();
echo "Rating: " . $a['average'] . "\n";
output:3.5 (example)

0 comments:

Post a Comment