Hello.
I have a minor issue with is_dir(). When running two almost identical
scripts from two different directories with same target directory I get
different output. The only difference between the scripts is a variable
containing the path to the target directory.
The scripts are located here:
http://ionline.dk/test/test1.php
http://ionline.dk/test/files/test2.php
Contents of the scripts:
http://ionline.dk/test/test1.php:
<html>
<head>
<title></title>
</head>
<body>
<?php
$dir = getcwd() . '/files' ;
echo '<h1>Listing content of ' . $dir . '</h1>' . "\n";
echo '<table><tr><td>file</td><td>is_dir()</td></tr>' . "\n";
$dir = dir($dir);
while(false !== ($entry = $dir->read())){
if($entry != 'index.php')
echo '<tr><td>' . $entry . '</td><td>' . is_dir($entry) .
'</td></tr>' . "\n";
}
$dir->close();
echo '</table>'
?>
</body>
</html>
http://ionline.dk/test/test1.php:
<html>
<head>
<title></title>
</head>
<body>
<?php
$dir = getcwd();
echo '<h1>Listing content of ' . $dir . '</h1>' . "\n";
echo '<table><tr><td>file</td><td>is_dir()</td></tr>' . "\n";
$dir = dir($dir);
while(false !== ($entry = $dir->read())){
if($entry != 'index.php')
echo '<tr><td>' . $entry . '</td><td>' . is_dir($entry) .
'</td></tr>' . "\n";
}
$dir->close();
echo '</table>'
?>
</body>
</html>
Any suggestions on what is causing this is appreciated.
Regards.