if file exists php
<p>I use following code to delete old image from ftp...</p>

<pre><code>unlink(getcwd() . '/images/' . $row['pic']);
</code></pre>

<p>But it throws errors in case there is not image, so i have tried using file_exists() but that didn't work too, so how can i check if there is an image before trying to delete. thanks.</p>

<pre><code>if(file_exists(getcwd() . '/images/pics/' . $row['pic'])) 
{ 
   unlink(getcwd() . '/images/pics/' . $row['pic']);
}
</code></pre>
