GlobIterator::count

(PHP 5 >= 5.3.0, PHP 7)

GlobIterator::countGet the number of directories and files

说锟斤拷

public GlobIterator::count ( void ) : int

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

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

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

锟斤拷锟斤拷

Example #1 GlobIterator::count() example

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

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

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

Matched 8 item(s)

锟轿硷拷

  • GlobIterator::__construct() - Construct a directory using glob
  • count() - 锟斤拷锟斤拷锟斤拷锟斤拷锟叫的碉拷元锟斤拷目锟斤拷锟斤拷锟斤拷锟斤拷械锟斤拷锟斤拷愿锟斤拷锟�
  • glob() - 寻锟斤拷锟斤拷模式匹锟斤拷锟斤拷募锟铰凤拷锟�