php strnatcmp()函数的用法总结
Definition and Usage
定义和用法
The strnatcmp() function pares two strings using a "natural" algorithm.
strnatcmp()函数的作用是用自然运算法则比较字符串(大小写敏感)。
In a natural algorithm, the number 2 is less than the number 10. In puter 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 pare 必要参数。指定参与比较的第一个字符串对象 |
string2 | Required. Specifies the second string to pare 必要参数。指定参数比较的第二个字符串对象 |
Tips and Notes
注意点
Note: The strnatcmp() is case-sensitive.
注意strnatcmp()函数是区分大小写的。
--------------------------------------------------------------------------------
Example
案例
<?phpecho strnatcmp("2Hello world!","10Hello world!");echo "<br />";echo strnatcmp("10Hello world!","2Hello world!");?>
The output of the code above will be:
上述代码将输出狼蚁网站SEO优化的结果-1 1
编程语言
- 宿迁百度关键词排名指南:实现精准营销的关键
- 四川SEO优化怎么做网络推广
- 立昂技术备案老域名收购:如何为您的业务赋能
- 安徽百度关键词seo贵不贵,一般需要多少钱
- 吉林百度快照排名怎么做电话营销
- 多伦新手做SEO怎么做
- 甘肃优化关键词排名推广怎么做论坛营销
- 沙雅SEO网站推广:提升您的在线可见性
- 四川SEO优化如何提升销售额和销售量
- 聂荣网站排名优化:提升网站可见性的全方位指
- 涞水SEO:提升地方企业在线可见性的策略
- 辽宁百度seo排名怎样做网站排名
- 临湘哪有关键词排名优化:提升网站可见度的关
- 黑龙江百度网站优化有没有优惠
- 凉城优化关键词排名推广:提升您的网络可见性
- 萝北整站优化:提升您网站流量和排名的全面指