【发布时间】:2012-05-13 17:11:49
【问题描述】:
我的file_exists() 返回false,即使提供的图像检查https://www.google.pl/logos/2012/haring-12-hp.png 是否存在。为什么?
下面我将展示准备在 localhost 上触发的完整失败的 PHP 代码:
$filename = 'https://www.google.pl/logos/2012/haring-12-hp.png';
echo "<img src=" . $filename . " />";
if (file_exists($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist";
}
【问题讨论】:
-
那么,你拥有谷歌,是吗?
Checks whether a file or directory exists.仅限本地。
标签: php