PHP - strnatcmp 函式



語法

int strnatcmp ( string $str1 , string $str2 )

定義和用法

它用於使用自然排序演算法比較兩個字串。

返回值

它返回字串函式

引數

序號 引數及描述
1

string1

指定要搜尋的第一個字串

2

string2

指定要搜尋的第二個字串

示例

嘗試以下示例

<?php
   echo strnatcmp("2sairam", "2kittuprasad");
?>

這將產生以下結果:

1
php_function_reference.htm
廣告