Check is file exists, not just the URL
<p>I've seen tutorials over the internet for this, but I cannot get it to work.</p>

<p>I've got this in a while loop, but it shouldn't matter:</p>

<pre><code>while($row = mysql_fetch_object($result)){
$image_url = $deviceimg.($row-&gt;Image);
if(!file_exists($image_url))
{}
else {
$image_url = 'images/android.png';
}
</code></pre>

<p>Basically, im my database, all the rows called Image are populated, but only some of them have an actual file.  What im trying to do is check to see if the image file actually exists on the server, if it doesn't use a default image (images/android.png)</p>

<p>No matter that I do, it will either replace ALL images with the default, or it will just use the URL in the database, regardless of if the file actually exists.</p>
