Re: unexpected include parse error
| From: | Paul Furman | Date: | Tue, 27 Jan 2004 04:59:59 +0000 |
| Subject: | Re: unexpected include parse error | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175847@lists.php.net to get a copy of this message | ||
David Obrien wrote:
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.