title: Accessing YouTube yt:rating (like/dislike) system in PHP
body: <p>I'm using PHP to access YouTube video attributes e.g. title, url, thumbnail, duration etc.</p>
  
  <p>Not that gd:rating (5 star ratings) has been replaced by yt:rating (like/dislike system), I'm trying to modify my PHP.</p>
  
  <p><strong>gd:rating (old)</strong></p>
  
  <pre><code>$gd = $entry-&gt;children('http://schemas.google.com/g/2005');  
  if ($gd-&gt;rating) {  
      $attrs = $gd-&gt;rating-&gt;attributes();  
      $rating = $attrs['average'];   
  } else {  
      $rating = 0;   
  }
  </code></pre>
  
  <p><strong>yt:rating (new)</strong></p>
  
  <pre><code>$yt = $entry-&gt;children('http://gdata.youtube.com/schemas/2007');  
  if ($yt-&gt;rating &amp;&amp; $yt-&gt;rating[0]-&gt;attributes()) {  
      $attrs = $yt-&gt;rating[0]-&gt;attributes();  
      $videoobj[$loopCounter]['dislikes'] = strval($attrs['numDislikes']);  
      $videoobj[$loopCounter]['likes'] = strval($attrs['numLikes']);  
  } else {  
      $videoobj[$loopCounter]['dislikes'] = 0;  
      $videoobj[$loopCounter]['likes'] = 0;  
  }
  </code></pre>
  
  <p>Using the yt:rating code didn't work.  Even if I do a <code>print_r($yt->rating);</code>, there is nothing in the array.</p>
  
  <p>Where am I going wrong?</p>