CONSTANTS Flashcards
0
Q
How do you create a constant in php ?
A
Use define method. E.g. define( CONSTANT_NAME, “value”)
1
Q
Can Php constants be undefined or changed?
A
They cannot be undefined or changed.
2
Q
How do you call a constant in php?
A
By simply referring to the constant name.
3
Q
What is the difference between functions constant() and get_defined_constants() in php?
A
constant() function is used to read the constants blue if you wish to obtain the name dynamically.
get_defined_constants() gets a list of all defined name constants