Thursday, 20 September 2012

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)

Share This!



No comments:

Post a Comment

Here We Write The Problems we face at different situations and Solutions to those problems.