RealPath returns an empty string
Posted
by Abs
on Stack Overflow
See other posts from Stack Overflow
or by Abs
Published on 2010-05-13T23:21:39Z
Indexed on
2010/05/13
23:24 UTC
Read the original article
Hit count: 242
Hello all,
I have the following which just loops through the files in a directory and echo the file names. However, when I use realpath, it returns nothing. What am I doing wrong:
if ($handle = opendir($font_path)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != "a.zip") {
echo $file.'<br />';//i can see file names fine
echo realpath($file);// return empty string?!
}
}
closedir($handle);
}
Thanks all for any help on this.
~I am on a windows machine, running php 5.3 and apache 2.2.
© Stack Overflow or respective owner