Jump to content

Archived

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

Chevy

How would i...

Recommended Posts

How would I got about banning spaces?

[code]if (!ereg ("([0-9a-zA-Z_])", $username)) {[/code]

thats all I want to allow is 0-9, a-z, A-Z and _'s....but spaces somehow find there way threw....can you help me?

Share this post


Link to post
Share on other sites
You didn't use anchors. [code]!preg_match('/^\w+$/', $string)[/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.