Checks username value against the rule: must be at least 6 characters long and at most 12 characters long, only allowed alphanumeric symbols
if (!preg_match('/^[a-zA-Z0-9]{6,12}$/', $username)) {
    $this->addError('username', 'username must be 6-12 chars & alphanumeric');
}
by Valeri Tandilashvili
4 years ago
PHP
functions
Object Oriented PHP Tutorial
1
Pro tip: use ```triple backticks around text``` to write in code fences