I like how this works in Zend Framework. I can know which environment I\'m currently using by checking APPLICATION_ENV constant in my controller.
you can also access it from the $_SERVER variable.
$_SERVER