glob://

glob://Find pathnames matching pattern

Description

The glob: stream wrapper.

Usage

  • glob://

Options

Wrapper Summary
AttributeSupported
Restricted by allow_url_fopenNo
Restricted by allow_url_includeNo
Allows ReadingNo
Allows WritingNo
Allows AppendingNo
Allows Simultaneous Reading and WritingNo
Supports stat()No
Supports unlink()No
Supports rename()No
Supports mkdir()No
Supports rmdir()No

Examples

Example #1 Basic usage

<?php
// Loop over all *.php files in ext/spl/examples/ directory
// and print the filename and its size
$it = new DirectoryIterator("glob://ext/spl/examples/*.php");
foreach(
$it as $f) {
printf("%s: %.1FK\n", $f->getFilename(), $f->getSize()/1024);
}
?>
tree.php: 1.0K findregex.php: 0.6K findfile.php: 0.7K dba_dump.php: 0.9K nocvsdir.php: 1.1K phar_from_dir.php: 1.0K ini_groups.php: 0.9K directorytree.php: 0.9K dba_array.php: 1.1K class_tree.php: 1.8K
To Top