SplFileInfo::isDir

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

SplFileInfo::isDirTells if the file is a directory

Beschreibung

publicSplFileInfo::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)
To Top