note 97398 added to function.glob
| From: | Anonymous at osu1 dot php dot net | Date: | Sat, 17 Apr 2010 21:41:15 +0000 |
| Subject: | note 97398 added to function.glob | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-168356@lists.php.net to get a copy of this message | ||
With respect, tailinchu's approach is a very ineffiicient and potentially costly approach to
handling the issue of glob returning false. Instead, try:
if(is_array($files = glob('*.txt'))){
// You have matches, and you didn't glob twice
...
...
}
Cheers,
MB
----
Server IP: 192.41.40.227
Probable Submitter: 66.220.104.38
----
Manual Page -- http://www.php.net/manual/en/function.glob.php
Edit -- https://master.php.net/note/edit/97398
Del: integrated -- https://master.php.net/note/delete/97398/integrated
Del: useless -- https://master.php.net/note/delete/97398/useless
Del: bad code -- https://master.php.net/note/delete/97398/bad+code
Del: spam -- https://master.php.net/note/delete/97398/spam
Del: non-english -- https://master.php.net/note/delete/97398/non-english
Del: in docs -- https://master.php.net/note/delete/97398/in+docs
Del: other reasons-- https://master.php.net/note/delete/97398
Reject -- https://master.php.net/note/reject/97398
Search -- https://master.php.net/manage/user-notes.php