Home > Article > Backend Development > strspn() function in PHP
strspn() function returns the number of characters found in the string of the charlist parameter.
strspn(str,charlist,begin,len)
str - The string to search for
charlist - The character to find
start - Where to start in the string
len - The length of the string
strspn() function returns the number of characters found in the string of the charlist parameter. If the string is not found, returns false.
The following is an example -
Real-time demonstration
<?php echo strspn("mobilephone","o"); ?>
The following is the output -
0
The above is the detailed content of strspn() function in PHP. For more information, please follow other related articles on the PHP Chinese website!