PHP Doku:: Return path and file name of current DirectoryIterator item - directoryiterator.getpathname.html

Verlauf / Chronik / History: (1) anzeigen

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

Ein Service von Reinhard Neidl - Webprogrammierung.

The DirectoryIterator class

<<DirectoryIterator::getPath

DirectoryIterator::getPerms>>

DirectoryIterator::getPathname

(PHP 5)

DirectoryIterator::getPathnameReturn path and file name of current DirectoryIterator item

Beschreibung

public string DirectoryIterator::getPathname ( void )

Get the path and file name of the current file.

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Returns he path and file name of current file. Directories do not have a trailing slash.

Beispiele

Beispiel #1 DirectoryIterator::getPathname() example

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

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

/home/examples/.
/home/examples/..
/home/examples/apple.jpg
/home/examples/banana.jpg
/home/examples/getpathname.php
/home/examples/pear.jpg

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",...)