Chevy Posted June 8, 2007 Share Posted June 8, 2007 Is it possible to reverse the strtolower function? Here is my code. foreach($filout as $replace){ $badwords = eregi_replace($filout,$nobadwords,strtolower($badwords)); } and yes, I need to str it to lower to check the bad words haha Link to comment https://forums.phpfreaks.com/topic/54814-reverse-strtolower/ Share on other sites More sharing options...
Dragen Posted June 8, 2007 Share Posted June 8, 2007 You can't 'undo' a lower, but you can make it all upper with: strtoupper but I don't think that's what you want. Instead of changing it to lower case, why don't you just do a case insesitive search? Link to comment https://forums.phpfreaks.com/topic/54814-reverse-strtolower/#findComment-271079 Share on other sites More sharing options...
Chevy Posted June 8, 2007 Author Share Posted June 8, 2007 How would I go about doing that? Link to comment https://forums.phpfreaks.com/topic/54814-reverse-strtolower/#findComment-271081 Share on other sites More sharing options...
paul2463 Posted June 8, 2007 Share Posted June 8, 2007 eregi_replace() is case insensitive anyway Description string eregi_replace ( string $pattern, string $replacement, string $string ) This function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters. courtesy of the <a href="http://uk.php.net/manual/en/function.eregi-replace.php"> MANUAL </a> Link to comment https://forums.phpfreaks.com/topic/54814-reverse-strtolower/#findComment-271086 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.