note 96063 deleted from function.end by danbrown
| From: | danbrown@php.net | Date: | Sat, 06 Feb 2010 16:11:51 +0000 |
| Subject: | note 96063 deleted from function.end by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165711@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
in response to http://www.php.net/manual/en/function.end.php#95904
why wouldn't you just trim the string when you're done with it? eg:
foreach ($urlOptions as $option){
$selectOptions.=$option.",";
}
$selectOptions = trim($selectOptions, ', ');
that way you're not calling an if statement and indexing the array an extra time for each
iteration