How do you define a constant in PHP?
- define('MY_CONSTANT', 'constant value');
- $constant('MY_CONSTANT')
- constant('MY_CONSTANT')
- MY_CONSTANT = 'constant value';
In PHP, you define a constant using the define function. The correct syntax is define('CONSTANT_NAME', 'constant_value').
Loading...
Related Quiz
- Which of the following are ways to create a file in PHP?
- The PHP $_SESSION superglobal is used to store information about a user session.
- The for loop in PHP tests the condition ______ executing the block of code.
- The value of a class constant in PHP cannot be changed once it is ______.
- What is the actually used PHP version?