PHP strcoll() 函数

PHP 教程 · 2019-01-30 07:26:51

实例

比较字符串:

<?php
setlocale (LC_COLLATE, 'NL');
echo strcoll("Hello World!","Hello World!");
echo "<br>";

setlocale (LC_COLLATE, 'en_US');
echo strcoll("Hello World!","Hello World!");
?>

定义和用法

strcoll() 函数比较两个字符串。

字符串的比较会根据本地设置而变化(A<a 或 A>a)。

注释:strcoll() 是区分大小写的,但不是二进制安全的。

注释:如果当前的本地设置是 C 或 POSIX,则该函数的工作方式与 strcmp() 相同。

语法


strcoll(string1,string2)


参数 描述
string1 必需。规定要比较的第一个字符串。
string2 必需。规定要比较的第二个字符串。

技术细节

返回值: 该函数返回:
  • 0 - 如果两个字符串相等
  • <0 - 如果 string1 小于 string2
  • >0 - 如果 string1 大于 string2
PHP 版本: 4.0.5+
更新日志: 自 PHP 4.2.3 起,该函数可以在 win32 上工作。

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

A Guide to Monte Carlo Simulations in Statistical Physics

A Guide to Monte Carlo Simulations in Statistical Physics

Landau, David P./ Binder, Kurt / Cambridge Univ Pr / 2005-9 / 786.00元

This new and updated edition deals with all aspects of Monte Carlo simulation of complex physical systems encountered in condensed-matter physics, statistical mechanics, and related fields. After brie......一起来看看 《A Guide to Monte Carlo Simulations in Statistical Physics》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码