the \ has to be slashed
".\\";
Ah great, thanks! that fixes most of the errors. The following runs where I define the $dirstr in the function but if I try to define it in the page that calls the function, it still gives
Parse error, unexpected T_INCLUDE in [#call]
#call $dirstr= ".//" this is where I want to define the directory include 'scandir.php'; scandir('$dirstr');
#function
function scandir($dirstr) {
$files = array();
#$dirstr=".//";
$fh = opendir($dirstr);
while (false !== ($filename = readdir($fh))) {
array_push($files, $filename);
}
closedir($fh);
return $files;
}PS I'm on my windows apache server but the forward slash seems to work in php & that keeps it portable. I tried it both ways.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

