ctype_alnum

Supported Versions: PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8
Check for alphanumeric character(s)
<?php ctype_alnum(mixed $text): bool
<?php     public function isValidId($id)

    {

        return is_string($id) && ctype_alnum($id) && strlen($id) === 40;

    }
<?php     public function toBeAlphaNumeric(string $message = ''): self

    {

        Assert::assertTrue(ctype_alnum((string) $this->value), $message);



        return $this;

    }
<?php         $encoded = '';

        for ($i = 0; isset($string[$i]); $i++) {

            $character = $string[$i];

            if (!ctype_alnum($character) && !in_array($character, array('-', '_'), true)) {

                $character = '%' . sprintf('%02X', ord($character));

            }

            $encoded .= $character;
<?php         if ($tag_constant === self::TAG_DELIMITER) {

            if (strlen($tag) > 1) {

                throw new RuleBrokenError('Preg delimiter can not be over 1 in length.');

            } else if (ctype_alnum($tag) || $tag === '\\') {

                throw new RuleBrokenError('Preg Delimiter can not be alphanumeric or backslash.');

            }

        }