Home » » glob

glob

Written By 1 on Sunday, September 30, 2012 | 6:58 PM

array glob ( string $pattern [, int $flags = 0 ] )

Find pathnames matching a pattern

The glob() function searches for all the pathnames matching pattern according to the rules used by the libc glob() function, which is similar to the rules used by common shells.


<?php
foreach (glob("*.txt") as $filename) {
    echo 
"$filename size " filesize($filename) . "\n";
}
?>

5.1.0 GLOB_ERR was added 4.3.3 GLOB_ONLYDIR became available on Windows and other systems not using the GNU C library


PHP List Directory

0 Comment:

Post a Comment