Zend supports the creation of true constants (as opposed to
regular variables). Constants are accessed without the typical
dollar sign ($) prefix and are available in all
scopes. Examples include TRUE and
FALSE, to name just two.
To create your own constants, you can use the macros in
Table 53-6.
All the macros create a constant with the specified name and value.
You can also specify flags for each constant:
CONST_CS - This constant's name is to be
treated as case sensitive.
CONST_PERSISTENT - This constant is
persistent and won't be "forgotten" when the current process
carrying this constant shuts down.
To use the flags, combine them using a inary OR:
// register a new constant of type "long"
REGISTER_LONG_CONSTANT("NEW_MEANINGFUL_CONSTANT", 324, CONST_CS |
CONST_PERSISTENT);
There are two types of
macros - REGISTER_*_CONSTANT
andREGISTER_MAIN_*_CONSTANT. The first type
creates constants bound to the current module. These constants are
dumped from the symbol table as soon as the module that registered
the constant is unloaded from memory. The second type creates
constants that remain in the symbol table independently of the
module.
Registers a new constant of type string. The string length
is explicitly set to length. The specified string must reside
in Zend's internal memory.
Php zend.variables.constant Function syntax tag
zend.variables.constant php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online
Php zend.variables.constant syntax tutorial
php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.