downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

InfiniteIterator> <GlobIterator::__construct
[edit] Last updated: Fri, 25 May 2012

view this page in

GlobIterator::count

(PHP 5 >= 5.3.0)

GlobIterator::countディレクトリやファイルの数を取得する

説明

public int GlobIterator::count ( void )

glob 式から見つかったディレクトリやファイルの数を取得します。

パラメータ

この関数にはパラメータはありません。

返り値

返されたディレクトリやファイルの数を integer で返します。

例1 GlobIterator::count() の例

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

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

上の例の出力は、 たとえば以下のようになります。

Matched 8 item(s)

参考

  • GlobIterator::__construct() - glob を使うディレクトリを作成する
  • count() - 変数に含まれるすべての要素、 あるいはオブジェクトに含まれる何かの数を数える
  • glob() - パターンにマッチするパス名を探す



add a note add a note User Contributed Notes GlobIterator::count
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites