Which of the following are valid PHP variable names?

  • $my_var
  • $123abc
  • $_VAR
  • All of the above
In PHP, variable names must start with a letter or an underscore (_), followed by any number of letters, numbers, or underscores. So, $my_var and $_VAR are valid variable names, but $123abc is not because it starts with a number. Learn more: https://www.php.net/manual/en/language.variables.basics.php
Add your answer
Loading...

Leave a comment

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