strspn.php : strspn « String « PHP






strspn.php

 
<?php
   $password = "1111111";
   if (strspn($password, "1234567890") == strlen($password))
      echo "The password cannot consist solely of numbers!";
?>
  
  








Related examples in the same category

1.strspn() function returns the length of the first segment in string1 containing characters also in string2.
2.strcspn demo
3.strcspn() function returns the length of the first segment in string1 containing characters not in string2.