【发布时间】:2014-02-18 10:32:03
【问题描述】:
当我使用这段代码(如下)时,它给了我 3 个错误。是我还是 Wampserver?我该怎么办?
<?php
$dir = "/gallery/";
$o = scandir($dir);
print_r($o);
?>
错误 1:
Warning: scandir(/gallery/,/gallery/) [<a href='function.scandir'>function.scandir</a>]: The system cannot find the file specified. (code: 2) in C:\wamp\www\random1\index.php on line 3
错误 2:
Warning: scandir(/gallery/) [<a href='function.scandir'>function.scandir</a>]: failed to open dir: No such file or directory in C:\wamp\www\random1\index.php on line 3
错误 3:
Warning: scandir() [<a href='function.scandir'>function.scandir</a>]: (errno 2): No such file or directory in C:\wamp\www\random1\index.php on line 3
【问题讨论】:
-
删除画廊前面的第一个/。
-
也可以去掉最后一个/
标签: php html wamp wampserver scandir