- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
strspn() function in PHP
The strspn() function returns number of characters found in the string from the charlist parameter.
Syntax
strspn(str,charlist,begin,len)
Parameters
str − The string to search
charlist − The characters to find
begin − Where to begin in the string
len − Length of the string
Return
The strspn() function returns number of characters found in the string from the charlist parameter. It returns false if string is not found.
Example
The following is an example −
<?php echo strspn("mobilephone","o"); ?>
Output
The following is the output −
0
Advertisements