PHP: Check if a file exists on a server
<p>Hey; I'm currently using the following way of checking whether an image exists on a server:</p>

<pre><code>if (@getimagesize($s3url))
   { 
      //do stuff 
   }
</code></pre>

<p>Needless to say, that's hardly the most elegant way of doing that... But honestly, I don't actually know where to start looking for a better solution. </p>

<p>I was wondering if perhaps it was possible to just send a request, receive a HTTP response (i.e. if the HTTP response is 200, carry on, if not, evaluate to false); but is that the best way?</p>

<p>What is the best function to check for the existence of an (image) file? </p>
