note 105662 deleted from function.glob by danbrown
| From: | danbrown@php.net | Date: | Tue, 06 Sep 2011 15:32:54 +0000 |
| Subject: | note 105662 deleted from function.glob by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182974@lists.php.net to get a copy of this message | ||
Note Submitter: jb_gfx at hotmail dot com
----
You better check the type of the return value (it's a common good practice) :
<?php
$result = glob("*.php");
if($result !== FALSE)
{
foreach($result as $file)
{
// ...
}
}
else
{
// no matches
}
?>