title: Get video duration from video url in php
body: <p>I need to display the play duration of a video on my website.</p>
  
  <p>I tried using <code>getid3</code> but it's not working, it's showing warnings like:</p>
  
  <blockquote>
    <p>preg_match() expects parameter 2 to be string, array given in C:\wamp\www\PE\getid3\getid3.php on line 262<br>
    Warning: is_readable() expects parameter 1 to be a valid path, array given in C:\wamp\www\PE\getid3\getid3.php on line 271<br>
    Warning: file_exists() expects parameter 1 to be a valid path, array given in C:\wamp\www\PE\getid3\getid3.php on line 271</p>
  </blockquote>
  
  <p>This are the warning 
  Etc., and the result is not showing.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  ini_set('display_errors',1);
  ini_set('display_startup_errors',1);
  ini_set('output_buffering','Off');
  error_reporting(-1);
  include_once("getid3/getid3.php");
  
  $getID3 = new getID3;
  $SongPath = pathinfo('http://localhost/PE/uploads/pe_discussion/videos/Wildlife.wmv');
  set_time_limit(30);
  $ThisFileInfo = $getID3-&gt;analyze($SongPath);
  getid3_lib::CopyTagsToComments($ThisFileInfo);
  echo 'File name: '.$ThisFileInfo['filenamepath'].'&lt;br&gt;';
  echo 'Artist: '.(!empty($ThisFileInfo['comments_html']['artist'])
      ? implode('&lt;BR&gt;', $ThisFileInfo['comments_html']['artist'])
      : '&amp;nbsp;').'&lt;br&gt;';
  echo 'Title: '.(!empty($ThisFileInfo['comments_html']['title'])
      ? implode('&lt;BR&gt;', $ThisFileInfo['comments_html']['title'])
      : '&amp;nbsp;').'&lt;br&gt;';
  echo 'Bitrate: '.(!empty($ThisFileInfo['audio']['bitrate'])
      ? round($ThisFileInfo['audio']['bitrate'] / 1000).' kbps'
      : '&amp;nbsp;').'&lt;br&gt;';
  echo 'Play time: '.(!empty($ThisFileInfo['playtime_string'])
      ? $ThisFileInfo['playtime_string']
      : '&amp;nbsp;').'&lt;br&gt;';
  ?&gt;
  </code></pre>