PHP - Function Strspn
Advertisements
Syntax
strspn(string,charlist,start,length)
Definition and Usage
It returns number of characters found in the string from the charlist parameter.
Return Values
It returns number of characters found in the string from the charlist parameter or else false if string is not found
Parameters
Sr.No | Parameters & Description |
---|---|
1 |
string It specifies the string to search |
2 |
length It specifies the string length |
3 |
start It specifies where to begin the start |
4 |
charlist It specifies characters to find |
Example
Try out the following example
Live Demo<?php echo strspn("tutorialspoint","t"); ?>
This will produce following result −
1
php_function_reference.htm
Advertisements