note 68869 modified in function.glob by sobak
| From: | sobak@php.net | Date: | Thu, 01 Dec 2016 06:26:00 +0000 |
| Subject: | note 68869 modified in function.glob by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207796@lists.php.net to get a copy of this message | ||
Please note that glob('*') ignores all 'hidden' files by default. This means it
does not return files that start with a dot (e.g. ".file").
If you want to match those files too, you can use "{,.}*" as the pattern with the
GLOB_BRACE flag.
<?php
// Search for all files that match .* or *
$files = glob('{,.}*', GLOB_BRACE);
?>
Note: This also returns the directory special entries . and ..
--was--
The answer for the difference in the dirsize function of "management at twilightus dot
net":
glob('*') ignores all 'hidden' files by default. This means it does not return
files that start with a dot (e.g. ".file").
If you want to match those files too, you can use "{,.}*" as the pattern with the
GLOB_BRACE flag.
<?php
// Search for all files that match .* or *
$files = glob('{,.}*', GLOB_BRACE);
?>
Note: This also returns the directory special entries . and ..
http://php.net/manual/en/function.glob.php