PHP 中的 strcoll函数

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

strcoll - 语法

int strcoll ( string $str1 , string $str2 )

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

Sr.No 参数 & 描述
1

str1

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

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

来源:LearnFk无涯教程网

2

str2

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

strcoll - 返回值

它返回字符串函数

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

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

技术教程推荐

React实战进阶45讲 -〔王沛〕

快速上手Kotlin开发 -〔张涛〕

Go语言核心36讲 -〔郝林〕

分布式数据库30讲 -〔王磊〕

如何读懂一首诗 -〔王天博〕

说透区块链 -〔自游〕

业务开发算法50讲 -〔黄清昊〕

后端工程师的高阶面经 -〔邓明〕

互联网人的数字化企业生存指南 -〔沈欣〕

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