Multi-lingual PHP
30th July 2002
A thread on SitePoint got me thinking about how PHP’s little known parse_ini_file()
function could be used to easily manage multiple language versions of web site messages. Sections could be set up for each supported language, with message definitions repeated in each section. You could even have a default message section at the top which is used when a message has not been defined for a particular language. The comments on the parse_ini_file manual page suggest that the function is not particularly suitable for large scale use—PHP exits if the ini file is malformed and it can’t handle files larger than 16,382 bytes. That said, rolling a more reliable native PHP version should be a trivial project.
More recent articles
- Reverse engineering some updates to Claude - 31st July 2025
- Trying out Qwen3 Coder Flash using LM Studio and Open WebUI and LLM - 31st July 2025
- My 2.5 year old laptop can write Space Invaders in JavaScript now, using GLM-4.5 Air and MLX - 29th July 2025