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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
jaymc Posted March 17, 2008 Author Share Posted March 17, 2008 Thank you 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.