In php multi-language settings, whether to store an entry into the database or store this array in a unified lang. php file, which one is better? In php multi-language settings, whether to store an entry into the database or store this array in a unified lang. php file, which one is better?
Reply content:
In php multi-language settings, whether to store an entry into the database or store this array in a unified lang. php file, which one is better?
Database + Cache
Read the database directly in the development mode, and manage and delete the database in the production mode cache + background.
File format. Putting data in the database seriously affects the database load.
Determine the language based on the IP address or user selection.
For example, if a Chinese user accesses a login. php page, the language array/locale/zh_CN/login. php of the page is loaded by default:
/Locale/zh_CN/login. php
'Login', 'username' => 'account', 'Password' => 'Password');/locale/en_US/login. php
'Login', 'username' => 'username', 'Password' => 'Password');/Login. php
Appendix: Install GeoIP extension in PHP. Obtain information such as the visitor's country, city, and latitude and longitude Based on the IP address.