![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Nov 2002
Location: Blah
Posts: 217
|
PHP experts how would you do this?
In perl say you did this:
$username =~ tr/[0-9a-zA-Z_\-]//csd; ( This would strip all but alphanumeric chars and _ and - chars ) What would be the equivelant in PHP? I can't seem to find one ![]() - Az |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: May 2002
Location: oregon.
Posts: 2,243
|
eregi("^[A-Za-z0-9_-]+$",$foo) is what i use.
so just change that to eregi_replace $username = eregi_replace("^[A-Za-z0-9_-]+$","",$username) i didn't like relying on \w or \W (and i think i had some problems with it)
__________________
php/mysql guru. hosting, coding, all that jazz. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Nov 2002
Location: Blah
Posts: 217
|
Excellent thanks.. I'll give it a shot.
- Az |
![]() |
![]() ![]() ![]() ![]() ![]() |