PHP: Why do we need string comparison function?
问题 The comparision operators < <= > >= can be applied for strings as well. So why do we need special function for string comparision: strcmp ? 回答1: Because there are several variations: Depending on the function, the answer to these questions vary: Is it case sensitive? (strcmp vs strcasecmp, strnatcmp vs strnatcasecmp) Depends it depend on the locale? (strcoll does) Can I specify a collation? (strcoll is affected by setlocale ) Additionaly, the comparison operators also give true or false .