unidox Posted May 11, 2008 Share Posted May 11, 2008 I am trying to replace any html tags with [ or ]. I keep getting this error: Warning: ereg_replace() [function.ereg-replace]: REG_EBRACK in function message($string) { global $db_connect; $string = ereg_replace("\'\";|`,", "", $string); $string = ereg_replace("[(<", "[", $string); $string = ereg_replace(")>]", "]", $string); return $string; } Whats wrong Link to comment https://forums.phpfreaks.com/topic/105098-solved-replace/ Share on other sites More sharing options...
DarkWater Posted May 11, 2008 Share Posted May 11, 2008 1) Why are you making your $db_connect available to the function...? 2) Why not just do: $string = str_replace("<", "[", $string"); $string = str_replace(">", "]", $string"); Link to comment https://forums.phpfreaks.com/topic/105098-solved-replace/#findComment-538043 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.