strspn() function in PHP

王林
Release: 2023-08-26 12:58:01
forward
1111 people have browsed it

strspn() function in PHP

strspn() function returns the number of characters found in the string of the charlist parameter.

Syntax

strspn(str,charlist,begin,len)
Copy after login

Parameters

  • str - The string to search for

  • < strong>charlist - The character to find

  • start - Where to start in the string

  • < li>

    len - The length of the string

Returns

strspn() function returns the number of characters found in the string of the charlist parameter. If the string is not found, returns false.

Example

The following is an example -

Real-time demonstration

<?php
   echo strspn("mobilephone","o");
?>
Copy after login

Output

The following is the output -

0
Copy after login

The above is the detailed content of strspn() function in PHP. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template