note 95719 added to function.glob

From: Date: Mon, 18 Jan 2010 11:43:23 +0000
Subject: note 95719 added to function.glob
Groups: php.notes 
Request: Send a blank email to php-notes+get-165069@lists.php.net to get a copy of this message
@tailinchu[at]gmail[dot]com This is not a good solution, because it will perform two FS operations, where only one is required. For what you want to achieve (being sure to work on an array), a typecast is much more suitable than a ternary operator: <?php $files = (array) glob('*.txt'); ?> ---- Server IP: 85.214.154.209 Probable Submitter: 62.112.80.25 ---- Manual Page -- http://www.php.net/manual/en/function.glob.php Edit -- https://master.php.net/note/edit/95719 Del: integrated -- https://master.php.net/note/delete/95719/integrated Del: useless -- https://master.php.net/note/delete/95719/useless Del: bad code -- https://master.php.net/note/delete/95719/bad+code Del: spam -- https://master.php.net/note/delete/95719/spam Del: non-english -- https://master.php.net/note/delete/95719/non-english Del: in docs -- https://master.php.net/note/delete/95719/in+docs Del: other reasons-- https://master.php.net/note/delete/95719 Reject -- https://master.php.net/note/reject/95719 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#165069) next »