array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'splfileinfo.isdir.php', 1 => 'SplFileInfo::isDir', 2 => 'Tells if the file is a directory', ), 'up' => array ( 0 => 'class.splfileinfo.php', 1 => 'SplFileInfo', ), 'prev' => array ( 0 => 'splfileinfo.gettype.php', 1 => 'SplFileInfo::getType', ), 'next' => array ( 0 => 'splfileinfo.isexecutable.php', 1 => 'SplFileInfo::isExecutable', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/spl/splfileinfo/isdir.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

SplFileInfo::isDir

(PHP 5 >= 5.1.2, PHP 7, PHP 8)

SplFileInfo::isDirTells if the file is a directory

Beschreibung

public SplFileInfo::isDir(): bool

This method can be used to determine if the file is a directory.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Returns true if a directory, false otherwise.

Beispiele

Beispiel #1 SplFileInfo::isDir() example

<?php
$d
= new SplFileInfo(dirname(__FILE__));
var_dump($d->isDir());

$d = new SplFileInfo(__FILE__);
var_dump($d->isDir());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(true)
bool(false)