DirectoryIterator
PHP 手册

DirectoryIterator::isDot

(PHP 5.1.0)

DirectoryIterator::isDotReturns true if current entry is '.' or '..'

说明

bool DirectoryIterator::isDot ( void )

Check whether the current entry is a directory and either . or ...

参数

This function has no parameters.

返回值

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
$dir 
= new DirectoryIterator(dirname(__FILE__));
foreach (
$dir as $fileinfo) {
    if (!
$fileinfo->isDot()) {
        echo 
'Filename '.$fileinfo->getFilename().PHP_EOL;
    }
}
?>


DirectoryIterator
PHP 手册