Jump to content

Archived

This topic is now archived and is closed to further replies.

rcleon

removing apostrophes

Recommended Posts

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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.