str_ireplace
November 12, 2010
On a project I had to do a php str_replace on a string but I ran into a problem as the string is user controlled. This could be upper case or lower so we needed something more. Without getting into things as complex as preg_replace I found str_ireplace. I can’t believe I hadn’t noticed this before. It’s the same as str_replace but is not case sensitive. Problem solved.