Check if the password contains only numbers in PHP
Description
The following code shows how to check if the password contains only numbers.
Example
<?php// ww w .ja va 2 s . co m
$password = "331231212345";
if (strspn($password, "1234567890") == strlen($password))
echo "The password cannot consist solely of numbers!";
?>
The code above generates the following result.