title: How can we check if we are running the PHP script on localhost?
body: <p>Is there a way to check if we are running a PHP script on localhost - development server or on live server - production server? Is there any PHP constant, variable, function,etc that can give me this information.</p>
  
  <p>I need this to put different settings for production and development server. Now I parse the URL to see which one it is but I was wondering s there any better way to do that. My concern is that we may change the URL of the script and that may ruin my check.</p>
  
  <p>I am looking few a solution with one config file and IF condition in it depending on which I will define different settings. The only problem is that I do not want to change the IF statement when there are changes on the server settings like hostname, document_root or something else that I am using to identify local/remote host.</p>
  
  <p>And want to SVN update from one source without changing anything to my production server.</p>
  
  <p>And I would like ideally to be able to run and CRON jobs with these settings.</p>