foochuck Posted August 4, 2009 Share Posted August 4, 2009 Hello, I developed a website using PHP5 and just found it's being hosted on a server using PHP4. Could someone let me know what the alternative to the function 'stripos' is in PHP4? Here is a sample of my code: if (stripos($_SERVER['SCRIPT_NAME'],'index') !== false) { $bodyClass = "homeBG"; } Thanks! foochuck Link to comment https://forums.phpfreaks.com/topic/168830-solved-stripos-alternative-in-php4/ Share on other sites More sharing options...
jonsjava Posted August 4, 2009 Share Posted August 4, 2009 from php.net: <?php function stripos($haystack, $needle){ return strpos($haystack, stristr( $haystack, $needle )); } $strTest = "The brown fox jumped over the Fence"; echo stripos($strTest, 'fence');//30 ?> Link to comment https://forums.phpfreaks.com/topic/168830-solved-stripos-alternative-in-php4/#findComment-890757 Share on other sites More sharing options...
foochuck Posted August 4, 2009 Author Share Posted August 4, 2009 Thanks jonsjava! Link to comment https://forums.phpfreaks.com/topic/168830-solved-stripos-alternative-in-php4/#findComment-890759 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.