1. You can switch to the city where the visitor is located based on the external IP of the website visitor, and automatically save the cookie value to speed up the next visit! 2. IP data comes from Sina API, which is very accurate. 3. You need to refresh to see the city information, because cookies need to be set for the first visit. You can make a jump page to solve this problem. 4. In order to facilitate the demonstration and viewing, automatic switching is not made, just header("Location:)