improvement the function of heavyraptor with int offset parametre.
if (!function_exists("stripos")) {
function stripos($str,$needle,$offset=0)
{
return strpos(strtolower($str),strtolower($needle),$offset);
}
}
![]() | striposDescriptionint stripos ( string haystack, string needle [, int offset] )Returns the numeric position of the first occurrence of needle in the haystack string. Unlike strpos(), stripos() is case-insensitive. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return boolean FALSE.
If needle is not a string, it is converted to an integer and applied as the ordinal value of a character. The optional offset parameter allows you to specify which character in haystack to start searching. The position returned is still relative to the beginning of haystack.
See also strpos(), strrpos(), strrchr(), substr(), stristr(), strstr(), strripos() and str_ireplace(). ![]()
rchillet at hotmail dot com
28-Apr-2006 04:45
improvement the function of heavyraptor with int offset parametre.
heavyraptor
21-Mar-2006 10:59
If you're using PHP < 5, you can use this alternate function, same thing like stripos:
sim
03-Oct-2004 01:17
Just to be explicit, the position index returned by strpos starts at 0, not 1. e.g. strpos('abc','a') returns 0.
aidan at php dot net
31-May-2004 01:36
This functionality is now implemented in the PEAR package PHP_Compat. | ![]() |