When running this script :
<?
$d = "/fichiers"; // dir to show
$h = opendir($d);
while($e = readdir($h))
{
echo filetype("$d/$e");
echo "<br>\n";
}
closedir($h);
?>
the wrong filetype is displayed (files and directories are displayed as directories), except when the script is run in the current (.) directory