最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時間:2013年11月27日 08:41:36   作者:  
這篇文章主要是對php中strnatcmp()函數(shù)的用法進行了詳細的總結(jié)介紹,需要的朋友可以過來參考下,希望對大家有所幫助

Definition and Usage
定義和用法
The strnatcmp() function compares two strings using a "natural" algorithm.
strnatcmp()函數(shù)的作用是:用自然運算法則比較字符串(大小寫敏感)。

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.
在“自然運算法則”中,2比10小。在計算機序列當(dāng)中,10比2小,因為“10”中的第一個數(shù)字是“1”,它小于2。

This function returns:
這個函數(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
語法

復(fù)制代碼 代碼如下:

strnatcmp(string1,string2)
Parameter參數(shù) Description描述
string1 Required. Specifies the first string to compare
必要參數(shù)。指定參與比較的第一個字符串對象
string2 Required. Specifies the second string to compare
必要參數(shù)。指定參數(shù)比較的第二個字符串對象

Tips and Notes
注意點
Note: The strnatcmp() is case-sensitive.
注意:strnatcmp()函數(shù)是區(qū)分大小寫的。

--------------------------------------------------------------------------------

Example
案例

復(fù)制代碼 代碼如下:

<?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

相關(guān)文章

最新評論

肥西县| 河西区| 横峰县| 临夏县| 吕梁市| 通河县| 淅川县| 河间市| 西丰县| 从化市| 隆子县| 社旗县| 屏边| 宜宾市| 岳普湖县| 新和县| 文水县| 临朐县| 新宁县| 上蔡县| 宁都县| 吉木乃县| 石家庄市| 信宜市| 和平县| 永春县| 沂南县| 柳江县| 孟村| 汤原县| 临江市| 阿拉尔市| 宿松县| 鄂伦春自治旗| 健康| 博兴县| 云龙县| 镇沅| 库伦旗| 呼和浩特市| 晋州市|