rcleon Posted June 24, 2006 Share Posted June 24, 2006 Hi, I have the following expression and it is working I just need to also remove (') apostrophesbut I can get it to work.$username = preg_replace("#[^a-z]#i","",$username);Any help will be apriciated.ThanksRafael Quote Link to comment https://forums.phpfreaks.com/topic/12784-removing-apostrophes/ Share on other sites More sharing options...
wildteen88 Posted June 24, 2006 Share Posted June 24, 2006 If you want to remove ' from s users username use str_replace instead:[code]$username = str_replace("'', '', $username);[/code]If you want to remove other characters from the username, such as double quotes you can do this:[code]$username = str_replace(array("'",'"'), '', $username);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/12784-removing-apostrophes/#findComment-49046 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.