jaymc Posted March 17, 2008 Share Posted March 17, 2008 How can I make str_replace ignore case, can it be turned off or do i need another function For instance, should be treated the same as Link to comment https://forums.phpfreaks.com/topic/96621-str_replace-binary/ Share on other sites More sharing options...
Jeremysr Posted March 17, 2008 Share Posted March 17, 2008 Use str_ireplace. It's exactly the same but case-insensitive. Edit: It's only available in PHP 5 though. Link to comment https://forums.phpfreaks.com/topic/96621-str_replace-binary/#findComment-494435 Share on other sites More sharing options...
trq Posted March 17, 2008 Share Posted March 17, 2008 str_ireplace(). Its amazing what you find in the manual. Link to comment https://forums.phpfreaks.com/topic/96621-str_replace-binary/#findComment-494436 Share on other sites More sharing options...
roopurt18 Posted March 17, 2008 Share Posted March 17, 2008 Little tip for these items in the future. If you're on the str_replace page in the manual and ctrl + f and search for 'insensitive' it leads right to it. I use the find feature in my web browser all the time (especially highlight all in FF) and it always amazes me how many people overlook it. Link to comment https://forums.phpfreaks.com/topic/96621-str_replace-binary/#findComment-494440 Share on other sites More sharing options...
PFMaBiSmAd Posted March 17, 2008 Share Posted March 17, 2008 The Note: section on the str_replace() page in the manual also contains a reference to related functions - Note: This function is case-sensitive. Use str_ireplace() for case-insensitive replace. Link to comment https://forums.phpfreaks.com/topic/96621-str_replace-binary/#findComment-494451 Share on other sites More sharing options...
jaymc Posted March 17, 2008 Author Share Posted March 17, 2008 Thank you Link to comment https://forums.phpfreaks.com/topic/96621-str_replace-binary/#findComment-494471 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.