post icon

PHP Code to check if its running on ‘localhost’ or not

sometime we have to run two different code’s, one on local machine another set of code on live server.

So to check it

if($url == “http://localhost”)
//code to be run on local machine
// code to run on server machine

April 8, 2013

Comments are closed.

Leave a comment