2012-06-12 56 views

回答

0
$file = WWW_ROOT . 'img' . DS . 'uploads' . DS . 'file123.jpg'; 
+0

你能解釋一下嗎? –

0

喜歡的應用程序/ Web根目錄/ IMG /上傳/ file123.jpg我的圖片路徑

WWW_ROOT定義你的根目錄文件夾路徑和DS定義 '/'

$image='file123.jpg'; 
$file = WWW_ROOT . 'img' . DS . 'uploads' . DS . $image; 

如果文件檢查的條件

if(file_exists($file) && $image){ 
enter your code if file exists 
}else{ 
file not exists 
}