note 56410 deleted from function.trim by hholzgra
| From: | hholzgra@php.net | Date: | Thu, 02 Aug 2012 12:23:25 +0000 |
| Subject: | note 56410 deleted from function.trim by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189642@lists.php.net to get a copy of this message | ||
Note Submitter: davis_utah at yahoo dot com
----
Just a word of caution when looping through a batch of strings (in the thousands or more). Using
trim to take off a left over character (like a comma in a csv output) will result in a much slower
execution. It is better to use a tiny bit of conditional logic instead.
I believe the reason this is the case is because of having to create a new spot in memory to
temporarily handle the result of trim.
Hope this helps.