PHP 4, PHP 5, PHP 7, PHP 8
strspn - Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask
Strspn Online Tool
Code Examples

Example #1 strspn example

Result: int(0) int(2) int(1)
PHP Version:

Example #2 of strspn

PHP Version:

Function strspn:

Strings Functions

Most used PHP functions