This is my code:
$flags=FileSystemIterator::CURRENT_AS_FILEINFO | FileSystemIterator::SKIP_DOTS;
$ul = new FileSystemIterator(__DIR__."/../",$flags);
// $ul = new FileSystemIterator("/../",$flags);
foreach($ul as $file){
if($file->isDir()){
print $file->getFilename()."<br />";
}
}
Its DIR is /var/www/html/dir1/dir2/dir3/test.php
It shows as the result of command : ls /var/www/html/dir1/dir2/
replace $ul = new FileSystemIterator(__DIR__."/../",$flags);
with $ul = new FileSystemIterator("/../",$flags);
It shows as the result of command : ls /var/www/html/dir1/
Why the second show happen?