PHP Doku:: Get the number of directories and files - globiterator.count.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige GrunderweiterungenStandard PHP Library (SPL)IteratorenThe GlobIterator classGlobIterator::count

Ein Service von Reinhard Neidl - Webprogrammierung.

The GlobIterator class

<<GlobIterator::__construct

The InfiniteIterator class>>

GlobIterator::count

(PHP 5 >= 5.3.0)

GlobIterator::countGet the number of directories and files

Beschreibung

public integer GlobIterator::count ( void )

Gets the number of directories and files found by the glob expression.

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

The number of returned directories and files, as an integer.

Beispiele

Beispiel #1 GlobIterator::count() example

<?php
$iterator 
= new GlobIterator('*.xml');

printf("Matched %d item(s)\r\n"$iterator->count());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Matched 8 item(s)

Siehe auch

  • GlobIterator::__construct() - Construct a directory using glob
  • count() - Zählt alle Elemente eines Arrays oder Attribute eines Objekts
  • glob() - Findet Dateinamen, die mit einem Muster übereinstimmen


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