title: localhost/live - detect by HTTP_HOST
body: <p>let's say I develop locally and debug small things on live server.</p>
  
  <p>Is it good idea to have something like this in my code? :</p>
  
  <pre><code>$is_local = (strpos($_SERVER['HTTP_HOST'], 'localhost') !== false);
  define ('DEBUG',$is_local);
  </code></pre>
  
  <p>And then use it through my code, when setting stuff?</p>
  
  <pre><code>$mysql_settings = (DEBUG) ? 
    array(/*localhost settings*/) : 
    array(/*live settings*/);
  </code></pre>
  
  <p>This way, I can use the same files live and on localhost, so I can sync without any fear of having wrong e.g. connection settings on live server.</p>
  
  <p>Is it good or wrong idea?</p>