title: How to detect a user's language through their IP Address
body: <p>I have developed a website www.tenxian.com. </p>
  
  <p>It has three language versions, English, Japanese and Chinese. How can I write an effective PHP program which can automatically choose a language version based on the IP address of the visitor? </p>
  
  <p>If I use "if-else", the code would be much complicated; If I use switch-case, how to write it since the data which should be dealt with are IP ranges, not particular numbers. Besides, I don't know these IP ranges</p>
  
  <p>What is the easiest way to do it?</p>