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 Quote Link to comment 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"); 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.