0
我要檢查圖像是否存在:檢查圖像是否
<?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" >
產量爲:NOT FOUND,而圖像顯示以及..奇怪吧?我在這裏錯了什麼?
+1爲了澄清[PHP HTTP包裝(http://www.php.net/manual/en/wrappers.http.php)不支持'stat()'這就是爲什麼askers代碼不起作用。有關更多信息,請參見[file_exists](http://php.net/manual/en/function.file-exists.php)文檔。 – Treffynnon