,
strspn($string, '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_') == strlen($string)
The strspn () function finds the length of the initial segment of the string $, which contains only letters, numbers, and the underscore (second argument). If the whole string consists only of letters, numbers, and underscores, the return value will be equal to the length of the string.
source
share