PHP declare function

Note: This is not a YII question but rather just simple php

I am creating a simple php code to get a date.

<?php $today = date(‘l \t\h\e jS’);

define('TODAY','&#036;today'); 





echo 'Today is '.TODAY.'' ;

?>

The above code does not work.

I am planing to get the value for $today variable in define function.

I can however do it simple way by just replacing TODAY in " echo ‘Today is ‘.TODAY.’’ ; " with $today…

But i want to know what variable is not working inside the define constant.

is that illegal ?

[color="#006400"]/* Moved from Tutorials to Misc - General PHP */[/color]

http://php.net/manual/en/function.define.php

Do not quote the variable, and don’t use single-quotes for the constant:


define("TODAY", $today); 

And you shouldn’t be using define anyway. Class constants my boy!