note 65253 added to function.strpos
| From: | ludvigdotericsonatgmaildotcom at osu1 dot php dot net | Date: | Thu, 27 Apr 2006 20:28:30 +0000 |
| Subject: | note 65253 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-109880@lists.php.net to get a copy of this message | ||
As a simplified way of doing what the poster below did:
<?php
$firstName .= '\'';
if (!preg_match('/[sx]$/', $firstName)) {
$firstName .= 's';
}
?>
If you feel using a regular expression is too much, try it - I've not tested yet, but I'd
say preg_match() is faster then two strpos() calls.
----
Server IP: 129.16.214.50
Probable Submitter: 213.89.141.235
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.strpos.php
Edit -- http://master.php.net/note/edit/65253
Del: integrated -- http://master.php.net/note/delete/65253/integrated
Del: useless -- http://master.php.net/note/delete/65253/useless
Del: bad code -- http://master.php.net/note/delete/65253/bad+code
Del: spam -- http://master.php.net/note/delete/65253/spam
Del: non-english -- http://master.php.net/note/delete/65253/non-english
Del: in docs -- http://master.php.net/note/delete/65253/in+docs
Del: other reasons-- http://master.php.net/note/delete/65253
Reject -- http://master.php.net/note/reject/65253
Search -- http://master.php.net/manage/user-notes.php