check if file exists in php

前端 未结 6 1687
被撕碎了的回忆
被撕碎了的回忆 2020-12-03 17:02
if (!(file_exists(http://mysite.com/images/thumbnail_1286954822.jpg))) {   
$filefound = \'0\';                         
}

why won\'t this work?

6条回答
  •  粉色の甜心
    2020-12-03 17:12

    for me also the file_exists() function is not working properly. So I got this alternative solution. Hope this one help someone

    $path = 'http://localhost/admin/public/upload/video_thumbnail/thumbnail_1564385519_0.png';
    
        if (@GetImageSize($path)) {
            echo 'File exits';
        } else {
            echo "File doesn't exits";
        }
    

提交回复
热议问题