strspn function example tutorial_PHP tutorial

WBOY
Release: 2016-07-20 11:00:19
Original
917 people have browsed it

Definition and usage
The strspn() function returns the number of characters found in the string containing only characters from the charlist.

Grammar

strspn(string,charlist,start,length)


Parameters

Description

string: required. Specify string search

charlist:request. The specified character is found

start: optional. Where the specified string starts

length: optional. String prompts and instructions of specified length Note: This feature is binary safe.

Example 1

echo strspn("Hello world!","kHlleo");


?>

The result is: 5

Let’s look at another strspn tutorial.


echo strspn("abcdefand","abc");


?>

The result is 3


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445512.htmlTechArticleDefinition and Usage The strspn() function returns the number of characters found in the string containing only characters from the charlist. Syntax strspn(string,charlist,start,length) Parameter Description string: required. Refers to...
source:php.cn
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