PHP ~ validate username

/^[A-Za-z0-9_]+$/

---------------------------------------------------------------------------------

$ssss = 's123123(sdsdsdsd';

if(preg_match('/^[A-Za-z0-9_]+$/', $ssss))
{
print 'match';
}else{
print 'no';
}


reference
http://stackoverflow.com/questions/1330693/php-validate-username-as-alphanumeric-with-underscores

沒有留言: