robert_gsfame Posted July 27, 2009 Share Posted July 27, 2009 friends, how can i prevent " \ " this special character using ereg for example " . " then i will use ereg("\.",$data) so how bout " \ " and how prevent those special such as "." "*" "%"characters being typed in one preg thanks Quote Link to comment https://forums.phpfreaks.com/topic/167633-ereg/ Share on other sites More sharing options...
Daniel0 Posted July 27, 2009 Share Posted July 27, 2009 All characters are always escaped using the backslash character, including the backslash, so that would be \\ You should use preg_match instead of ereg though. ereg() is slower than preg_match() and it's officially deprecated in PHP 5.3. Quote Link to comment https://forums.phpfreaks.com/topic/167633-ereg/#findComment-884061 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.