strspn: Find length of initial segment matching mask : strcspn « String « PHP
- PHP
- String
- strcspn
strspn: Find length of initial segment matching mask
<?php
$password = "3312345";
if (strspn($password, "1234567890") == strlen($password))
echo "The password cannot consist solely of numbers!";
?>
Related examples in the same category