RE: [PHP] Differences
| From: | admin | Date: | Thu, 04 Oct 2012 01:01:12 +0000 |
| Subject: | RE: [PHP] Differences | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-319346@lists.php.net to get a copy of this message | ||
function filename($prefix)
{
$array_to_return = array();
$matches = glob('images/property_pics/'.$prefix.'*');
foreach($matches as $filename){
$array_to_return[] = $filename;
}
return $array_to_return;
}
If this better explains it.
The first return will stop the process you need to put the information into
an array and then return the array outside of the foreach loop.