Q:

constants class in php

I once heard it's good to have one class with all your application constants so that you have only one location with all your constants.
I Tried to do it this way:
class constants{
    define("EH_MAILER",1);
}

and 
 class constants{
         const EH_MAILER =1;
 }

But both ways it doesn't work.
Any suggestions?

A:

In the current version of PHP this is the way to do it:
class constants
{
   const EH_MAILER = 1;
}

$mailer = constants::EH_MAILER

http://www.php.net/manual/en/language.oop5.constants.php

Starting with PHP 5.3 there's better way to do it. Namespaces. 
consts.php
<?php
namespace constants
const EH_MAILER = 1

...

other.php
<?php
include_once(consts.php)

$mailer = \constants\EH_MAILER

