PHP Dokumentation: Wrappers glob
12. Januar 2010 von werner
Glob
The glob: stream wrapper is available since PHP 5.3.0.
Beispiel #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.0Kfindregex.php: 0.6Kfindfile.php: 0.7Kdba_dump.php: 0.9Knocvsdir.php: 1.1Kphar_from_dir.php: 1.0Kini_groups.php: 0.9Kdirectorytree.php: 0.9Kdba_array.php: 1.1Kclass_tree.php: 1.8K
| Attribute | Supported |
|---|---|
| Restricted by allow_url_fopen | No |
| Restricted by allow_url_include | No |
| Allows Reading | No |
| Allows Writing | No |
| Allows Appending | No |
| Allows Simultaneous Reading and Writing | No |
| Supports stat() | No |
| Supports unlink() | No |
| Supports rename() | No |
| Supports mkdir() | No |
| Supports rmdir() | No |