ereg help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

ereg help

Post by tecktalkcm0391 »

Hello,

I'm getting the error:
Warning: ereg() [function.ereg]: Invalid range end in /include/classes/c_user.php on line 128
That line is:

Code: Select all

if (ereg('^[a-zA-Z0-9\-_]+$', $username)) {
            $this->username = $username;
            return true;
        }
What is wrong with my ereg expression?
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: ereg help

Post by ghurtado »

Try removing the backslash.
Post Reply