ID: 31674 Updated by: [EMAIL PROTECTED] Reported By: miika dot ahonen at mbnet dot fi -Status: Open +Status: Bogus Bug Type: *Directory/Filesystem functions Operating System: Linux PHP Version: 5.0.3 New Comment:
Brackets make a character class,just as in regular expressions. Escape them with a \. Previous Comments: ------------------------------------------------------------------------ [2005-01-24 03:31:07] miika dot ahonen at mbnet dot fi Description: ------------ In an attempt to glob() directory with bracket ('[' and/or ']') in its name, I get no results at all. Reproduce code: --------------- $dir = "./dir[with]brackets"; if (!is_dir($dir)) mkdir($dir); for ($i = 0; $i < 3; $i++) file_put_contents($dir."/file.".$i, "foo".$i."\n"); var_dump( glob($dir."/*") ); Expected result: ---------------- Array containing files in the said directory. Actual result: -------------- Empty array. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31674&edit=1