PHP strcspn() FunctionThe strcspn() is predefined function of PHP. It is used to find the length of initial segment or returns the number of characters including whitespaces found in a string. Note: This function is binary-safe.Syntax:
Example 1Output: Your string is: Hello Javatpoint By using strcspn() function:16 Example 2Output: Your string is: Hello Javatpoint By using strcspn() function:5 Example 3Output: int(0) Example 4Output: int(0) Example 5Output: int(2) Example 6Output: int(2) Example 7Output: int(5) Example 8Output: int(4) References: http://php.net/manual/en/function.strcspn.php Next TopicPHP String |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India