Validation\Validator\Alnum

Class Phalcon\Validation\Validator\Alnum

extends abstract class Phalcon\Validation\Validator

implements Phalcon\Validation\ValidatorInterface

Source on GitHub

Check for alphanumeric character(s)

use Phalcon\Validation\Validator\Alnum as AlnumValidator;

$validator->add(
    "username",
    new AlnumValidator(
        [
            "message" => ":field must contain only alphanumeric characters",
        ]
    )
);

$validator->add(
    [
        "usern