Re: strtok buggy ?
| From: | Stanislav Malyshev | Date: | Wed, 28 Jun 2000 12:18:51 +0000 |
| Subject: | Re: strtok buggy ? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-22614@lists.php.net to get a copy of this message | ||
CS>> It seem that strtok trouble with the 0 string. Try this little
CS>> script :
CS>>
CS>> $str = "ta-mere-en-0-short";
CS>> $tok = strtok ($str,"-");
CS>> while ($tok)
No, there's trouble with your while. "0" has false value when converted to
boolean. Use != "" or something like that.
--
Stanislav Malyshev stas@zend.com
+972-3-6139665