How to use strcspn in PHP

In this article I will explain how strcspn function used in PHP.
  • 1199

strcspn() Function

This function gives us Position of the characters found in a string before any part of the string characters are found.

Syntax

strcspn(string,char,start,length)

Example

<html>
<body>
<?php
echo strcspn("Hello Anjali!","a");
?>
</html>
</body>

Output

strcspn-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.