📌  相关文章
📜  按字母顺序比较字符串 php - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:51.896000             🧑  作者: Mango

代码示例1
Use strcmp.
If the first argument to strcmp is lexicographically smaller to the second, then the value returned will be negative.
If both are equal, then it will return 0.
And if the first is lexicograpically greater than the second then a positive number will be returned.

Bonus fact: You probably want to use strcasecmp(string1,string2), which ignores case.