URL exists gives "Does not Exists"
<p>To check if url exists not regular file</p>

<pre><code>Tried
1. file_exists - just a test, should not be for a url
2. empty
3. fopen
</code></pre>

<p>All the above gave a "<strong>Does not exists</strong></p>

<pre><code>if(fopen("http://www.google.com",r)){ echo "exists"; } else { echo "doesnot exist"; }
</code></pre>

<p>I have ran out of ideas as to why its happening.  the file has been given 777.  Code is being tested from 127.0.0.1.</p>

<p>This is the only code on the page.  I do not wish to use curl, and keep it simple and normal coding.  Checked on Google and other Q's on stackoverflow</p>

<p>All I want to check is if the URL is real.</p>
