note 82229 added to function.strpos
| From: | ilaymyhat-rem0ve at yahoo dot com | Date: | Wed, 02 Apr 2008 00:17:34 +0000 |
| Subject: | note 82229 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137839@lists.php.net to get a copy of this message | ||
This might be useful.
class String{
//Look for a $needle in $haystack in any position
public static function contains(&$haystack, &$needle, &$offset)
{
$result = strpos($haystack, $needle, $offset);
return $result !== FALSE;
}
//intuitive implementation .. if not found returns -1.
public static function strpos(&$haystack, &$needle, &$offset)
{
$result = strpos($haystack, $needle, $offset);
if ($result === FALSE )
{
return -1;
}
return $result;
}
}//String
----
Server IP: 117.104.160.194
Probable Submitter: 202.7.183.132 (proxied: 60.242.65.120)
----
Manual Page -- http://www.php.net/manual/en/function.strpos.php
Edit -- https://master.php.net/note/edit/82229
Del: integrated -- https://master.php.net/note/delete/82229/integrated
Del: useless -- https://master.php.net/note/delete/82229/useless
Del: bad code -- https://master.php.net/note/delete/82229/bad+code
Del: spam -- https://master.php.net/note/delete/82229/spam
Del: non-english -- https://master.php.net/note/delete/82229/non-english
Del: in docs -- https://master.php.net/note/delete/82229/in+docs
Del: other reasons-- https://master.php.net/note/delete/82229
Reject -- https://master.php.net/note/reject/82229
Search -- https://master.php.net/manage/user-notes.php