substr_compare(string1,string2,startpos,length,case)
它用于比较特定起始位置的两个字符串格式
Sr.No | 参数 & Description |
---|---|
1 |
string1 用于第一个字符串进行比较 |
2 |
string2 用于第二个字符串进行比较 链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-substr-compare.html 来源:LearnFk无涯教程网 |
3 |
startpos 它指定在string 1中开始字符串比较的位置 |
4 |
length 它指定字符串的长度 |
5 |
case 指定在何处执行区分大小写比较的布尔值 |
它返回字符串函数
<?php echo substr_compare("SAi RAM","RAM",6); ?>
这将产生以下输出-
-5
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)
HarmonyOS快速入门与实战 -〔QCon+案例研习社〕