Why file_exists() function doesn't work correctly?
<p>Here is my code:</p>

<pre><code>&lt;?php $filename = $var.'p_folder/'.sub_replace('?','',$page).'/images/default.png'; ?&gt;
&lt;img src  = "&lt;?php echo $filename; ?&gt;"
     title= "&lt;?php echo file_exists($filename) ? 'exists' : 'not exist'; ?&gt;" 
&gt;
</code></pre>

<p>My code shows the image as well, but <code>file_exists()</code> returns false <em>(I mean "not exist" prints)</em>.. Why?</p>

<p>Actually that's pretty much odd for me .. because I can see the image on the web, so it means the image exists on the directory, but why  <code>file_exists()</code> cannot find it?</p>