note 96063 added to function.end
| From: | Anonymous at osu1 dot php dot net | Date: | Sat, 06 Feb 2010 01:21:56 +0000 |
| Subject: | note 96063 added to function.end | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165704@lists.php.net to get a copy of this message | ||
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
----
Server IP: 69.147.83.197
Probable Submitter: 63.150.3.118
----
Manual Page -- http://www.php.net/manual/en/function.end.php
Edit -- https://master.php.net/note/edit/96063
Del: integrated -- https://master.php.net/note/delete/96063/integrated
Del: useless -- https://master.php.net/note/delete/96063/useless
Del: bad code -- https://master.php.net/note/delete/96063/bad+code
Del: spam -- https://master.php.net/note/delete/96063/spam
Del: non-english -- https://master.php.net/note/delete/96063/non-english
Del: in docs -- https://master.php.net/note/delete/96063/in+docs
Del: other reasons-- https://master.php.net/note/delete/96063
Reject -- https://master.php.net/note/reject/96063
Search -- https://master.php.net/manage/user-notes.php