【发布时间】:2013-02-11 00:17:54
【问题描述】:
这是我的代码。
$filename = "$myMedia catalog/category/ $myImage.png";
$filename = str_replace(" ", "", $filename);
if (file_exists($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist";
}
上面的variable 输出确实存在的http://50.87.6.244/~storeupp/media/catalog/category/Game_Used.png。但是,它说它不存在。
知道为什么吗?
【问题讨论】:
-
对不起。我进行了搜索,但找不到问题所在:(
-
如果您只是要在下一行删除空格,为什么还要在
$filename中添加空格?
标签: php