How to use strspn in PHP

In this article I will explain how strspn function used in PHP.
  • 1878

strspn() Function

This function returns the number of characters in the string that have only characters from the char list.

Syntax

strspn(string,charlist,start,length)

Example

<html>
<body>
<?php
echo strspn("Hllo Prem!","sHlleo");
?>
</body>
</html>

 

Output


strspn-php.jpg

You may also want to read these related articles Click here

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.