DirectoryIterator::isDot

(PHP 5, PHP 7)

DirectoryIterator::isDotDetermine if current DirectoryIterator item is '.' or '..'

说锟斤拷

public DirectoryIterator::isDot ( void ) : bool

Determines if the current DirectoryIterator item is a directory and either . or ..

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

TRUE if the entry is . or .., otherwise FALSE

锟斤拷锟斤拷

Example #1 A DirectoryIterator::isDot() example

This example will list all files, omitting the . and .. entries.

<?php
$iterator 
= new DirectoryIterator(dirname(__FILE__));
foreach (
$iterator as $fileinfo) {
    if (!
$fileinfo->isDot()) {
        echo 
$fileinfo->getFilename() . "\n";
    }
}
?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

apple.jpg
banana.jpg
example.php
pears.jpg

锟轿硷拷