title: Strange behaviour from file_exists
body: <p>I am having trouble checking if an image exists or not I have tried using file_exists but always get a false response from it.</p>
  
  <pre><code>$fjpg = $code . ".jpg";
  $imurl = "producers/$dir/images/$fjpg";
  if(file_exists($imurl))
  {
  
  $cimage = &lt;&lt;&lt;end
      &lt;a href="$imurl"&gt;&lt;span style="color:#990000;"&gt;&lt;b&gt;$code&lt;/b&gt;&lt;/span&gt;:&amp;nbsp; $desc&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
      end;
      }
      $cimage = &lt;&lt;&lt;end
      &lt;span style="color:#990000;"&gt;&lt;b&gt;$code&lt;/b&gt;&lt;/span&gt;:&amp;nbsp; $desc&lt;/div&gt;&lt;/td&gt;
      end;
  </code></pre>
  
  <p>The heredoc is just there due to my growing frustration. I have got end; with no spaces in front of it in the actual file. What is more perplexing is that in the same file working fine is the following</p>
  
  <pre><code>&lt;?
  if (file_exists("producers/$dir/header.php")) {
      include("producers/$dir/header.php");
  }
  ?&gt;
  </code></pre>
  
  <p>I have tried using is_file with the same results.
  I have swapped the two statements around and used the link provided to get to the file so my assumption is that $imurl gives a workable path just not one that file_exists needs. 
  I have used <code>echo getcwd();</code> as Jompper suggested and get
   /home/caliver/public_html/figures </p>