note 76226 deleted from function.trim by hholzgra
| From: | hholzgra@php.net | Date: | Thu, 02 Aug 2012 12:25:07 +0000 |
| Subject: | note 76226 deleted from function.trim by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189652@lists.php.net to get a copy of this message | ||
Note Submitter: moehbass at gmail dot com
----
Responding to Robin Leffmann:
jayoungh5 wrote a function to trim whitespace on the left, on the right, in the middle, everywhere
(Below). It iterates through the string's characters. Yours, claimed to be faster, uses a regex
function. I think it should be slower since I believe that dealing with a regex is iterative in
nature and add to that the possibility of recursion! Perhaps your function is shorter in code lines.
I am not absolutely positive, so take this as a clue but research for a more solid truth.