August 2000
Intermediate to advanced
800 pages
13h 15m
English
Constants are similar to variables, but they may be set only once. Some of them are created automatically by PHP; others you will create with the define function discussed in Chapter 9. You do not use the dollar-sign operator to get the value of a constant, and a constant may never be used on the left side of an assignment operator. Constants ignore scope and are therefore visible inside functions without the use of the global statement.
Although it is not necessary, it is customary to name constants exclusively with capital letters. This helps make them stand out in your script, as in Listing 2.6.
|
|
Read now
Unlock full access