A problem occurs in the project. Different servers have different running results.
The reason is that some functions related to locale are used and the server locale is different. These functions are summarized as follows:
String:
| Strtoupper |
Convert uppercase letters |
| Strtolower |
Convert lowercase letters |
| Ucfirst |
Uppercase letters |
| Sprintf |
Some formatting is related |
| Ctype_alpha |
Check whether all letters exist |
| Ctype_alnum |
Check whether all numbers exist. |
| Ctype_cntrl |
Check whether all characters are controlled |
| Ctype_upper |
Check whether all uppercase letters are used |
| Ctype_lower |
Check whether all lowercase letters are used |
Date-related:
| Gmstrftime |
Format GMT/UTC time/date according to region settings |
| Strftime |
Format local time/date according to region settings |
| Strptime |
The time returned by strftime processing is an array. |
Currency:
| Money_format |
Format the number in currency format |
Finally, there are locale related functions:
| Setlocale |
Set local |
| Localeconv |
Obtain digit-related locale information |
As a domestic phper, it is inevitable to encounter many problems related to locale. At this time, it is best to use the MB _ * series functions and clearly specify the relevant character set to avoid these problems.