I've noticed in both of your posts that you aren't terminating the line before the include with a ;
That would probably help. FYI... If you use / then you don't have to escape it like // only the \. Also, instead of ".\\" you can use '.\' -Shawn "Paul Furman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php