Which PHP function is used to create a constant?
- define()
- var()
- constant()
- assign()
The define() function in PHP is used to create a constant. It takes two arguments: the constant name (identifier) and its value. Once defined, constants cannot be changed or redefined during the execution of the script. They provide a way to store fixed values that remain the same throughout the script's execution. Learn more: https://www.php.net/manual/en/function.define.php
Loading...
Related Quiz
- You need to define a constant in your PHP script that can be accessed anywhere in the script, regardless of scope. How would you do this?
- You have a for loop in your PHP script that is not terminating as expected. What could be the possible reasons and how would you debug this?
- You have a PHP script and you need to get data sent in the URL's query string. How would you do this using the $_REQUEST superglobal?
- You need to get the error message of the last JSON operation in your PHP script. How would you do this?
- In PHP file upload, the $_FILES array contains keys like 'name', 'type', 'size', 'tmp_name', and 'error' which represent ______.