$username=ereg_replace("/.", "", $username); $username=ereg_replace("/-", "", $username);
I want it so that it removes . and - from the username.
Whats wrong with the above?
$username=ereg_replace(".", "", $username); $username=ereg_replace("-", "", $username);
Try this:
The slashes are the wrong direction.
Hi,
this one should do it,too:
$username=preg_replace("/[.-]/", "", $username);
or
$username=str_replace(".","",$username); $username=str_replace("-","",$username);
Thomas
maqmus @ Tried that, still does not work 🙂
rebelo @ All I can do is blame the laptop keyboard 😛
tsinka @ Thanks, I used your first one liner. Cheers!
Thanks everyone!