国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 語(yǔ)言 > PHP > 正文

php strnatcmp()函數(shù)的用法總結(jié)

2024-09-04 11:49:53
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

這篇文章主要是對(duì)php中strnatcmp()函數(shù)的用法進(jìn)行了詳細(xì)的總結(jié)介紹,需要的朋友可以過來(lái)參考下,希望對(duì)大家有所幫助。

Definition and Usage

定義和用法

The strnatcmp() function compares two strings using a "natural" algorithm.

strnatcmp()函數(shù)的作用是:用自然運(yùn)算法則比較字符串(大小寫敏感)。

In a natural algorithm, the number 2 is less than the number 10. In computer sorting, 10 is less than 2, because the first number in "10" is less than 2.

在“自然運(yùn)算法則”中,2比10小。在計(jì)算機(jī)序列當(dāng)中,10比2小,因?yàn)?ldquo;10”中的第一個(gè)數(shù)字是“1”,它小于2。

This function returns:

這個(gè)函數(shù)將返回下列值:

•0 - if the two strings are equal

0 – 如果字符串相等

•<0 - if string1 is less than string2

<0 – 如果string1小于string2

•>0 - if string1 is greater than string2

>0 – 如果string1大于string2

Syntax

語(yǔ)法:

strnatcmp(string1,string2)

Parameter參數(shù)

Description描述

string1

Required. Specifies the first string to compare

必要參數(shù)。指定參與比較的第一個(gè)字符串對(duì)象

string2

Required. Specifies the second string to compare

必要參數(shù)。指定參數(shù)比較的第二個(gè)字符串對(duì)象

Tips and Notes

注意點(diǎn)

Note: The strnatcmp() is case-sensitive.

注意:strnatcmp()函數(shù)是區(qū)分大小寫的。

Example

案例代碼如下:

  1. <?phpecho strnatcmp("2Hello world!","10Hello world!");echo "<br />";echo strnatcmp("10Hello world!","2Hello world!");?> 

The output of the code above will be:

上述代碼將輸出下面的結(jié)果:-1 1

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 江川县| 龙陵县| 化德县| 德惠市| 沈阳市| 青海省| 崇州市| 嘉禾县| 当雄县| 分宜县| 花莲市| 汕尾市| 阳谷县| 嵊州市| 南丹县| 宁海县| 和林格尔县| 陆丰市| 团风县| 都江堰市| 博乐市| 阜平县| 毕节市| 侯马市| 临邑县| 屏东市| 高平市| 珠海市| 兴隆县| 绩溪县| 志丹县| 富裕县| 杭州市| 昌邑市| 资中县| 旌德县| 合阳县| 闵行区| 兴文县| 武功县| 罗甸县|