Getting File and Folder List from Remote Server in PHP
<p>When I run: </p>

<pre><code>$url='foldername';
$dir = opendir($url);

//List files in images directory
while (($file = readdir($dir)) !== false)
  {

  echo "filename: " . $file . "&lt;br /&gt;";
  }
closedir($dir); 
</code></pre>

<p>...it outputs:</p>

<pre><code>filename: a.gif 
filename: file.html
filename: g.gif
filename: gg.html
</code></pre>

<p>I would like to see all the files and folders on another server from the URL:</p>

<pre><code>$url="http ://example.com"
</code></pre>

<p>How do I find the files and folder names from <code>example.com</code>?</p>
