note 80650 added to function.glob

From: Date: Sun, 27 Jan 2008 17:46:19 +0000
Subject: note 80650 added to function.glob
Groups: php.notes 
Request: Send a blank email to php-notes+get-135439@lists.php.net to get a copy of this message
As mentioned below, characters like [ and ] cause problems and need to be escaped with a backslash. But it's *not* enough to escape them in the pattern itself! If they appear in the path to the working directory, glob() also fails! So, if this fails: glob('*.txt'); Try: glob(preg_quote(getcwd() . DIRECTORY_SEPARATOR) . '*.txt'); ---- Server IP: 212.124.37.9 Probable Submitter: 88.72.217.204 ---- Manual Page -- http://www.php.net/manual/en/function.glob.php Edit -- https://master.php.net/note/edit/80650 Del: integrated -- https://master.php.net/note/delete/80650/integrated Del: useless -- https://master.php.net/note/delete/80650/useless Del: bad code -- https://master.php.net/note/delete/80650/bad+code Del: spam -- https://master.php.net/note/delete/80650/spam Del: non-english -- https://master.php.net/note/delete/80650/non-english Del: in docs -- https://master.php.net/note/delete/80650/in+docs Del: other reasons-- https://master.php.net/note/delete/80650 Reject -- https://master.php.net/note/reject/80650 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135439) next »