Which of the following are true about constants in PHP?
- Constants cannot be changed once defined
- Constants are always case-sensitive
- Constants can be accessed anywhere in the script
- All of the above
All of the above options are true about constants in PHP. Constants in PHP are values that cannot be changed or redefined once defined. They are case-sensitive, meaning that the constant names are treated as case-sensitive identifiers. Constants can be accessed anywhere in the script without regard to scope rules. These characteristics make constants useful for storing fixed values that remain consistent throughout the script's execution. Learn more: https://www.php.net/manual/en/language.constants.php
Loading...
Related Quiz
- In PHP, you can get the current date and time using the date() function, which takes a string format as the ______.
- What is an associative array in PHP?
- To delete a cookie in PHP, you can use the setcookie() function with an expiration date in the ______.
- In PHP, variables declared inside a function can be accessed outside of that function.
- What are some common uses of the fread() function in PHP?