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
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *