title: PHP: How to check if image file exists?
body: <p>I need to see if a specific image exists on my cdn.</p>
  
  <p>I've tried the following and it doesn't work:</p>
  
  <pre><code>if (file_exists(http://www.example.com/images/$filename)) {
      echo "The file exists";
  } else {
      echo "The file does not exist";
  }
  </code></pre>
  
  <p>Even if the image exists or doesn't exist, it always says "The file exists". I'm not sure why its not working...</p>