// 1) you can store the name of constant in default variable
// and use it without identify it's name :)
$str= "constName";
define("constName","this is constant");
echo constant($str);
output:
this is constant
// 2) good for dynamic generating constants
function generateConst( $const , $value , $sensitivity=TRUE )
{
define( "$const" , "$value ",$sensitivity);
}
$CONST="cost";
$VALUE="100$";
generateConst( $CONST , $VALUE);
echo constant($const);
output:
100$