小白教程
所有教程
关于
Search
172.70.130.239
172.70.130.239
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Func string strspn”的源代码
本页内容
上一节:
Func_string_strrpos
下一节:
Func_string_strstr
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:strspn()}}[[分类:PHP字符串函数参考手册|83]] = PHP strspn() 函数 = [[:分类:PHP字符串函数参考手册]] 返回在字符串 "Hello world!" 中包含字符 "kHlleo" 的数目: <sample title="" desc="" lang="php" hererun="1"> <?php echo strspn("Hello world!","kHlleo"); ?> </sample> == 定义和用法 == strspn() 函数返回在字符串中包含 charlist 参数中指定的字符数目。 '''提示:'''请使用 [[func string strcspn|strcspn()]] 函数来返回在找到任何指定的字符之前,在字符串查找的字符数。 '''注释:'''该函数是二进制安全的。 == 语法 == <pre> strspn(string,charlist,start,length) </pre> {| class="table table-striped table-hover" ! 参数 ! 描述 |- | string | 必需。规定被搜索的字符串。 |- | charlist | 必需。规定要查找的字符。 |- | start | 可选。规定在字符串的何处开始。 |- | length | 可选。定义字符串的长度。 |} == 技术细节 == {| class="table table-striped table-hover" | 返回值: | 返回在字符串中包含 charlist 参数中指定的字符数目。 |- | PHP 版本: | 4+ |- | 更新日志: | 在 PHP 4.3 中,新增了 start 和 length 参数。 |} == 更多实例 == == 实例 1 == 返回在字符串 "abcdefand" 中包含字符 "abc" 的数目: <sample title="" desc="" lang="php" hererun="1"> <?php echo strspn("abcdefand","abc"); ?> </sample> [[:分类:PHP字符串函数参考手册]]
返回至“
Func string strspn
”。
上一节:
Func_string_strrpos
下一节:
Func_string_strstr