Jump to content


Photo

removing apostrophes


  • Please log in to reply
1 reply to this topic

#1 rcleon

rcleon
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 24 June 2006 - 04:26 AM

Hi,

I have the following expression and it is working I just need to also remove (') apostrophes

but I can get it to work.

$username = preg_replace("#[^a-z]#i","",$username);

Any help will be apriciated.

Thanks

Rafael

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 24 June 2006 - 12:32 PM

If you want to remove ' from s users username use str_replace instead:
$username = str_replace("'', '', $username);

If you want to remove other characters from the username, such as double quotes you can do this:
$username = str_replace(array("'",'"'), '', $username);





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users