|
|
Tutorials » Php »
|
Topic |
What is strcspn Function?
|
|
Explanation |
|
In PHP this function returns the number of characters found in a string before any
part of the specified characters are found.
Syntax:
strcspn(string1,string2,start,length)
In the above syntax "string1" is the string in which "string2" is searched for, "start" specifies where in the string
to start,"length" specifies the length of the string to check for.
Example:
<?php
echo strcspn("Hiox India!","I");
?>
Result:
5
In the above strcspn Function example the string "I" is checked to return the result "5" as
it is found in "Hiox India!".
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|