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.
<VirtualHost *:80>
#ServerName
#DocumentRoot
SetEnv APPLICATION_ENV "development"
# Directory
</VirtualHost>
But unfortunately I can't use ZF in my current project. How can I check this environment variable in my PHP code?