note 12920 deleted from function.strpos by jimw
| From: | jimw@php.net | Date: | Thu, 18 Oct 2001 21:27:17 +0000 |
| Subject: | note 12920 deleted from function.strpos by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-19134@lists.php.net to get a copy of this message | ||
I tested this function on a WinNT-Server and a Linux-Server with PHP 4.0.5 and PHP 3.0.12.
It works great for me!
function stripos($haystack,$needle,$offset=0) {
$haystack = strtolower("$haystack");
$needle = strtolower("$needle");
// Comment the lines above for casesensitive search!
$pos = strpos($haystack, $needle, $offset);
if (!is_int($pos) && !$pos) {
// Not found
$pos = -1;
}
else {
// Found
}
return $pos;
}
Good luck!
Dennis M. Rose
http://www.communi.org