Bird
0
0

Why must PHP code be enclosed within <?php ?> tags in a file?

hard📝 Conceptual Q10 of 15
PHP - Basics and Execution Model
Why must PHP code be enclosed within <?php ?> tags in a file?
ATo comment out the PHP code
BTo make the code visible to users
CTo tell the server to process the code as PHP
DTo declare variables in PHP
Step-by-Step Solution
Solution:
  1. Step 1: Understand server processing

    PHP code inside <?php ?> tags is recognized and executed by the server.
  2. Step 2: Differentiate from other options

    Tags do not make code visible or comment it; variables are declared inside tags but tags themselves do not declare variables.
  3. Final Answer:

    To tell the server to process the code as PHP -> Option C
  4. Quick Check:

    PHP tags = server processing signal [OK]
Quick Trick: PHP tags signal server to run code [OK]
Common Mistakes:
  • Thinking tags show code to users
  • Confusing tags with comments
  • Assuming tags declare variables

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes