Bird
0
0

In PHP, what symbol must always precede a variable name when declaring it?

easy📝 Conceptual Q1 of 15
PHP - Variables and Data Types
In PHP, what symbol must always precede a variable name when declaring it?
AA dollar sign ($)
BAn ampersand (&)
CA hash (#)
DA percent sign (%)
Step-by-Step Solution
Solution:
  1. Step 1: Understand PHP variable syntax

    PHP variables always start with a dollar sign ($) followed by the variable name.
  2. Step 2: Identify the correct symbol

    Among the options, only the dollar sign ($) is used to declare variables in PHP.
  3. Final Answer:

    A dollar sign ($) -> Option A
  4. Quick Check:

    Variable declaration symbol = $ [OK]
Quick Trick: Always start PHP variables with $ sign [OK]
Common Mistakes:
  • Using & instead of $ for variables
  • Omitting the $ sign
  • Using special characters like # or %

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes