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

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.