如果图片是空的或是不存在则用指定的替换 if ($img=='' || !file_exists($img) ){ $img="/sc/touxiang.png"; } 未经允许不得转载:任鹏个人博客 » 判断文件是否存在