title: Get list of files from HTTP directory with PHP
body: <p>I am trying to get a list of files from a directory thorough PHP.
  I also tried via glob, but doesn't work with HTTP, tried recursively and this is the latest script I managed to found. Just that it doesn't work. it doesn't display the files.</p>
  
  <pre><code>&lt;?php
  $url = 'removed for security puposes';
  $html = file_get_contents($url);
  $count = preg_match_all('/&lt;td&gt;&lt;a href="([^"]+)"&gt;[^&lt;]*&lt;\/a&gt;&lt;\/td&gt;/i', $html, $files);
  for ($i = 0; $i &lt; $count; ++$i) {
    echo "File: " . $files[1][$i] . "&lt;br /&gt;\n";
  }
  var_dump($files);
  ?&gt;
  </code></pre>
  
  <p>The <code>var_dump($files);</code> is output </p>
  
  <pre><code>array(2) { 
       [0]=&gt; array(0) {
        } 
       [1]=&gt; array(0) 
        { } 
  } 
  </code></pre>
  
  <p>So what am I mistaking.</p>