日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php中的point用法,php strnatcmp()函数的用法总结

發布時間:2023/12/10 php 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php中的point用法,php strnatcmp()函数的用法总结 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

這篇文章主要是對php中strnatcmp()函數的用法進行了詳細的總結介紹,需要的朋友可以過來參考下,希望對大家有所幫助

Definition and Usage

定義和用法The strnatcmp() function compares two strings using a "natural" algorithm.

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

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小。在計算機序列當中,10比2小,因為“10”中的第一個數字是“1”,它小于2。

This function returns:

這個函數將返回下列值:

?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

語法

strnatcmp(string1,string2)

Parameter參數

Description描述

string1

Required. Specifies the first string to compare

必要參數。指定參與比較的第一個字符串對象

string2

Required. Specifies the second string to compare

必要參數。指定參數比較的第二個字符串對象

Tips and Notes

注意點

Note: The strnatcmp() is case-sensitive.

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

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

Example

案例

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

The output of the code above will be:

上述代碼將輸出下面的結果:-1 1

總結

以上是生活随笔為你收集整理的php中的point用法,php strnatcmp()函数的用法总结的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。