title: How to check if the php script is running on a local server?
body: <p>Is it possible to check if the website (php) is running locally or on a hosted server?
  I want to enable some logs if the website is running locally and I don't want these to appear on the site online..
  I can set a variable <code>$local=1;</code> but I'll have to change that before uploading.. is there anyway to automate this task?</p>
  
  <p>Local Server : WampServer 2.0 / Apache
  WebServer: Apache</p>