note 91752 added to function.strpos
| From: | nospam at nothanksafer3 dot com | Date: | Wed, 24 Jun 2009 17:09:24 +0000 |
| Subject: | note 91752 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157426@lists.php.net to get a copy of this message | ||
Hey all, if you're going to want to search an ENTIRE string for a $needle, or word, do NOT use
this function, use substr_count() instead.
This function will skip the first word in an array of provided strings.
EJ:
$mysentences = array('abc she', 'the she is silly','she hat',);
$find = she;
this function will NOT show a match for 'she hat' because the word 'she' is the
first word in the string
switch to substr_count() in order for it to work correctly and show a match for it as well
----
Server IP: 69.147.83.197
Probable Submitter: 76.21.15.234
----
Manual Page -- http://www.php.net/manual/en/function.strpos.php
Edit -- https://master.php.net/note/edit/91752
Del: integrated -- https://master.php.net/note/delete/91752/integrated
Del: useless -- https://master.php.net/note/delete/91752/useless
Del: bad code -- https://master.php.net/note/delete/91752/bad+code
Del: spam -- https://master.php.net/note/delete/91752/spam
Del: non-english -- https://master.php.net/note/delete/91752/non-english
Del: in docs -- https://master.php.net/note/delete/91752/in+docs
Del: other reasons-- https://master.php.net/note/delete/91752
Reject -- https://master.php.net/note/reject/91752
Search -- https://master.php.net/manage/user-notes.php