Path to a file in a different drive?

navand picture navand · Jul 8, 2011 · Viewed 7.3k times · Source

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";
}

Answer

Alex Rashkov picture Alex Rashkov · Jul 8, 2011

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.