$subject = $nick; $pattern = '/^[a-zA-Z0-9]{0,20}$/ '; if (!preg_match($pattern, $subject, $matches)) { $error_nick="1"; }
$subject = $nick; $pattern = '/^[a-zA-Z0-9]{0,20}$/ '; if (!preg_match($pattern, $subject, $matches)) { $error_nick="1"; } else { $error_nick = "0"; }
if($error_nick==0) { print 'valider nickname'; } else { print 'invalider nickname'; }