save files with specific name from site to disk drive
<p>Here is my code, it's not working perfectly. Can anybody help me to identify the problem?</p>

<pre><code>$urls = file('list.txt', FILE_IGNORE_NEW_LINES);
foreach($urls as $url) {
    copy(trim($url),"c:/data/$url");
    echo "$url is done";
    ob_flush();
    flush();
}       
</code></pre>

<p>Some URL's do not exist.</p>

<p>I want each file from URL to be saved with the name of the URL. </p>

<p>A URL will look like: <code>http://site.com/index.htm</code></p>
