title: PHP - How to detect user location
body: <p>I am developing web application and i need to know the location of the user they connecting from</p>
  
  <p>For example this website <a href="http://craigslist.org" rel="nofollow">www.craigslist.org </a> it can detect my location and redirect me to sub domain 
  So, it's redirect to:</p>
  
  <p><a href="http://cairo.craigslist.org" rel="nofollow">cairo.craigslist.org</a></p>
  
  <p><a href="http://boston.craigslist.org/" rel="nofollow">boston.craigslist.org/</a></p>
  
  <p>What is the best way to do that with PHP ?</p>
  
  <p><strong>PART TWO</strong></p>
  
  <p>How can i make it redirect to subdomain with country/city ? like the above example ?</p>