CONSTANTS Flashcards

0
Q

How do you create a constant in php ?

A

Use define method. E.g. define( CONSTANT_NAME, “value”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Can Php constants be undefined or changed?

A

They cannot be undefined or changed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you call a constant in php?

A

By simply referring to the constant name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly