If the constant does not exist, constant() will generate a warning and return null.
constantDescriptionmixed constant ( string name )constant() will return the value of the constant indicated by name. constant() is useful if you need to retrieve the value of a constant, but do not know its name. i.e. It is stored in a variable or returned by a function.
add a note
User Contributed Notes
04-Oct-2006 08:17
If the constant does not exist, constant() will generate a warning and return null.
narada dot sage at googlemail dot com
13-Jul-2006 09:01
To access the value of a class constant use the following technique.
service at dual-creators dot de
17-May-2006 01:00
It's easily to user constant() and define() to translate some words from your database-saves.
Trevor Blackbird > yurab.com
19-Apr-2006 05:58
Technically you can define constants with names that are not valid for variables:
timneill at hotmail dot com
26-Nov-2005 04:39
Please note when using this function from within a class to retrieve a php5 class constant, ensure you include the 'self::'.
11-Oct-2005 10:20
In reply to VGR_experts_exchange at edainworks dot com
Joachim Kruyswijk
14-Nov-2004 01:12
The constant name can be an empty string.
VGR_experts_exchange at edainworks dot com
19-Sep-2003 08:32
Hello. This applies to constants being defined as Boolean values, and may-be applies generally.
Andre
28-Apr-2003 04:10
Maybe this is useful:
| |||