1. Home
  2. Computer Science MCQs
  3. PHP
  4. Which of the following is a valid PHP variable name?

Added 20 Jan 2024

Which of the following is a valid PHP variable name?

  1. $var_name Correct answer
  2. $var-name
  3. $123var
  4. $var name

Correct answer

A. $var_name

17 views

MCQSEXAM

Explanation

PHP variables must start with a $ sign, followed by a letter or underscore.

Reference

Asked in: PHP Certification

https://www.php.net/manual/en/language.variables.basics.php

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More PHP MCQs

Practise all PHP MCQs

Similar MCQs