File url check in php
<p>I am trying to download a file and put its contents into the db using php. I am able to do that. But what if i have to check the url first and then if it exists, download, else report failure. How am i to do that?</p>

<p>say: $url = "...";</p>

<p>I need a condition:</p>

<p>if(file in the url exists)</p>

<p>{</p>

<pre><code>      report success;

      download;
</code></pre>

<p>}</p>

<p>else</p>

<pre><code>       report failure;
</code></pre>
