Strspns function example tutorial. Define and use the number of characters returned by the strspn () function. find the string that contains only characters from charlist. String: required. Definition and usage
The
Strspns() The number of characters returned by the function indicates that the string contains only characters from charlist.
Syntax
Strspns (string, charlist, start, length)
Parameters
Description
String: required. String search
Charlist: required. Find the specified character
Start: Optional. Start with the specified string
Length: Optional. Note: This function is binary secure.
Example 1
Echo strspn ("Hello world! "," KHlleo ");
?>
Result: 5
Let's look at another example.Strspns tutorial.
Echo strspn ("abcdefand" abc ");
?>
Result 3
Returns the number of characters returned by the strspn () function. the string contains only characters from charlist. String: required. ...