4

My php file is here: D:/Appserv/www/x/y/file.php

I want to load stuff from this folder: E:/foldie

I don't know what path will lead me there.

$somePath="HELP ME HERE!!!!"  
$dir=opendir($somePath);

//looping through filenames
while (false !== ($file = readdir($dir))) {
    echo "$file\n";
}
4

2 回答 2

5

Use full Windows path to the file it should be working: "E:\folder\file.txt"

or just copy the file in the local/project directory for testing purpose.

于 2011-07-08T18:38:24.233 回答
1

设置$somePath = "e:\\foldie"。如果这不起作用,请告诉我们它是如何失败的。

[编辑::确保你在字符串中转义你的反斜杠]

于 2011-07-08T18:39:51.280 回答