Home  >  Article  >  php教程  >  strspn 函数 实例教程

strspn 函数 实例教程

WBOY
WBOYOriginal
2016-06-13 11:16:551211browse

 

定义和用法
strspn ( )函数返回的字符数中找到字符串只包含字符从charlist 。

语法

strspn(string,charlist,start,length)


参数

说明

string:必需。指定字符串搜索

charlist:要求。指定的字符找到

start:任择。凡在指定的字符串开始

length:可选。规定长度的字符串提示和说明注:此功能是二进制的安全。

范例1

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


?>

结果为:5

再来看一个strspn教程.


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


?>

结果为3


Statement:
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