I get the following error:
Parse error: syntax error, unexpected ' ' (T_STRING) in G:\wamp\www\test100.php on line 6, I know thet for theswe error the fault usually lies before the line quoted, but I cannot see what.
Line 6 in Notepad++ is: if (is_dir($dir)) {
Any help greatly appreciated.
GY
Code: Select all
<?php
//$dir = "/etc/php5/";
$dir = "images/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype: " . filetype($dir . $file) . "\n";
}
closedir($dh);
}
}
?>