note 49803 deleted from function.str-split by aidan
| From: | aidan@php.net | Date: | Mon, 14 Feb 2005 05:12:13 +0000 |
| Subject: | note 49803 deleted from function.str-split by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-84984@lists.php.net to get a copy of this message | ||
Note Submitter: rob at the domain of torenware dt com
----
There is a subtle bug in Gregor Mosheh's function. If the last character of the string tested
is a "0", it will evaluate to false, and you will be missing a character off the end of
your string.
Ouch.
You should change
while($string)
to
while(strlen($str)).