php strcspn()函数 语法
php strcspn()函数 语法
作用:输出在字符串中找到某字符之前查找的字符数。直线电机参数
语法:strcspn(string,char,start,length)
参数:
| 参数 | 描述 |
| string | 必需。规定要搜索的字符串。 |
| char | 必需。规定要查找的字符。 |
| start | 可选。规定在字符串中何处开始查找。 |
| length | 可选。规定字符串的长度(搜索多少字符)。 |
说明:返回在找到任何指定的字符之前,在字符串查找的字符数(包括空格)。
php strcspn()函数 示例
<?php
echo strcspn("Hello php.cn!","p");
?>
浙公网安备 33010602011771号