title: How to get video duration using YouTube API?
body: <p>I want to get the duration of a Youtube video. Here's the code I tried:</p>
  
  <pre><code>$vidID="voNEBqRZmBc";
  //http://www.youtube.com/watch?v=voNEBqRZmBc
  $url = "http://gdata.youtube.com/feeds/api/videos/". $vidID;
  $doc = new DOMDocument;
  $doc-&gt;load($url);
  $title = $doc-&gt;getElementsByTagName("title")-&gt;item(0)-&gt;nodeValue;
  </code></pre>
  
  <p>Please check the XML file. I got the title of this video. I want to get duration from <code>&lt;yt:duration seconds='29'/&gt;</code>.</p>
  
  <p>How to get the <code>seconds</code> attribute this <code>&lt;yt&gt;</code> tag?</p>