strspn: Find length of initial segment matching mask : strcspn « String « PHP






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

1.strcspn($password, '1234567890')
2.strcspn Demo
3.See what portion of a string is composed only of a given set of characters