PHP Doku:: Determine if current DirectoryIterator item is executable - directoryiterator.isexecutable.html

Verlauf / Chronik / History: (6) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige GrunderweiterungenStandard PHP Library (SPL)IteratorenThe DirectoryIterator classDirectoryIterator::isExecutable

Ein Service von Reinhard Neidl - Webprogrammierung.

The DirectoryIterator class

<<DirectoryIterator::isDot

DirectoryIterator::isFile>>

DirectoryIterator::isExecutable

(PHP 5)

DirectoryIterator::isExecutableDetermine if current DirectoryIterator item is executable

Beschreibung

public bool DirectoryIterator::isExecutable ( void )

Determines if the current DirectoryIterator item is executable.

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Returns TRUE if the entry is executable, otherwise FALSE

Beispiele

Beispiel #1 DirectoryIterator::isExecutable() example

This example lists files in the directory containing the script which are executable.

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

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

example.php
myscript.sh

Siehe auch


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)