strcspn() 函数返回在找到任何指定的字符之前,在字符串查找的字符数。
strcspn(string,char,start,length)
注释:该函数是二进制安全的。
<?php echo strcspn("Hello world!","w"); ?>
strcspn("Hello world!","w")
输出:
6