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 Quote Link to comment 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 ?> Quote Link to comment Share on other sites More sharing options...
foochuck Posted August 4, 2009 Author Share Posted August 4, 2009 Thanks jonsjava! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.