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 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] Link to comment https://forums.phpfreaks.com/topic/12784-removing-apostrophes/#findComment-49046 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.