Jump to content

[SOLVED] Letters, Spaces and . -


Jessica

Recommended Posts

Actually if you want to include the '-' character it needs to appear first in a character class (or escape it, since it has special meaning inside the class, as in 'A-Z').
[code]if(!preg_match("/^[-A-Za-z.\s]+$/", $this->username)){
  $valid = 0;
}else{
  $valid = 1;
}[/code]

Archived

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

×
×
  • Create New...

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.