Bug #13730: StrPos is deficient
| From: | anthony at syntell dot net | Date: | Thu, 18 Oct 2001 09:42:04 +0000 |
| Subject: | Bug #13730: StrPos is deficient | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-68206@lists.php.net to get a copy of this message | ||
From: anthony@syntell.net
Operating system: Linux/Red Hat 7.1
PHP version: 4.0.6
PHP Bug Type: Feature/Change Request
Bug description: StrPos is deficient
re StrPOS, I suggest that you do the following.
Make another function with a different name, e.g. StrFind, that is
1) less problematic in distinguishing between found at pos zero and not
found. e.g. return -1 for not found.
2) case-insensitive, or (better) has an optional parameter ($casesensitive
= false) that defaults to false
You could also roll in last-occurence functionality a la strrpos with
option flags
After this, mark the StrPos function as obsolete/deprecated.
--
Edit bug report at: http://bugs.php.net/?id=13730&edit=1