Bug #13730 Updated: StrPos is deficient

From: Date: Tue, 19 Feb 2002 19:18:24 +0000
Subject: Bug #13730 Updated: StrPos is deficient
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-604@lists.php.net to get a copy of this message
ID: 13730 Updated by: dadarden@iti2.net -Reported By: anthony@syntell.net +Reported By: dadarden@iti2.net Status: Open Bug Type: Feature/Change Request Operating System: Linux/Red Hat 7.1 PHP Version: 4.0.6 New Comment: Or make the string position one based instead of zero based so that a return of 0 can be used for false and any other return is true. strstr() can usually be used that way, but seems to get confused looking for "/". Previous Comments: ------------------------------------------------------------------------ [2001-10-18 05:42:03] anthony@syntell.net 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 this bug report at http://bugs.php.net/?id=13730&edit=1

« previous php.bugs (#604) next »