PHP 中的 strcoll函数

首页 / PHP入门教程 / PHP 中的 strcoll函数

strcoll - 语法

int strcoll ( string $str1 , string $str2 )

它用于根据区域设置比较两个字符串

Sr.No 参数 & 描述
1

str1

它指定要比较的第一个字符串

2

str2

它指定要比较的第二个字符串

strcoll - 返回值

它返回字符串函数

链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-strcoll.html

来源:LearnFk无涯教程网

strcoll - 示例

<?php
   echo "If this function returns 0, the two strings are equal.";
   echo "<br> The result is ";
   
   setlocale (LC_COLLATE, 'NL');
   echo strcoll("Hello World!","Hello World!");
?>

这将产生以下输出-

If this function returns 0, the two strings are equal.
The result is 0

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

从0开发一款iOS App -〔朱德权〕

浏览器工作原理与实践 -〔李兵〕

Netty源码剖析与实战 -〔傅健〕

移动端自动化测试实战 -〔思寒〕

性能工程高手课 -〔庄振运〕

接口测试入门课 -〔陈磊〕

网络排查案例课 -〔杨胜辉〕

Python实战 · 从0到1搭建直播视频平台 -〔Barry〕

结构思考力 · 透过结构看问题解决 -〔李忠秋〕

好记忆不如烂笔头。留下您的足迹吧 :)