I want to check if the image is exist :
<?php
if(file_exists($this->baseUrl('upload/'.$this->lmObject->getLImage())) echo "EXIST";
else echo "NOT FOUND";
?>
<img src="<?php echo $this->baseUrl('upload/'.$this->lmObject->getLImage())?>" width="150" height="150" >
The output was : NOT FOUND while the image displayed well.. weird huh?. What I was wrong here?
You seem to be passing a URL
file_exists. This is not the correct way to use the function, and you should pass a filesystem path instead.You need to use something like: