1 php
$myfilepath = SITEROOT."/uploads/vaibhav_photo/thumbnail/".$user_avatar['thumbnail'];
if(file_exists($myfilepath))
{
echo "file exist";
}
else
{
echo "file does not exist";
}
Run Code Online (Sandbox Code Playgroud)
即使文件存在,它总是去其他部分.
如果有人在PHP中有替代选项,请尽快回复,
file_exists仅适用于文件路径.http://不支持网址.