hi dear
I will know about stripos()
I know , how to use stripos() function in to the php4.2.3?
please help me
stripos()
Moderator: General Moderators
Have a look at the first user comment at http://php.net/stripos
stripos is only available in PHP5. As PHP5 is still in RC status then there is no point in upgrading to PHP5 if you distribute your apps/scripts to the mass public.infolock wrote:quick and simple quesiton : why haven't you upgraded?
I would be very surprised if you found PHP5 installed on a production server at present and even when PHP5 reaches stable release status it will not make it onto production servers over night.
Here is my stripos function....
Code: Select all
<?php
if (!function_exists('stripos'))
{
function stripos($haystack, $needle, $offset = 0)
{
$temp = substr($haystack, $offset);
$temp = stristr($temp, $needle);
$pos = $temp !== false ? strlen($haystack)-strlen($temp) : false;
return $pos;
}
}
?>why not just:
??
Code: Select all
if (!function_exists('stripos'))
{
function stripos($haystack, $needle, $offset = 0)
{
return strpos(strtolower($haystack), strtolower($needle), $offset);
}
}