Bird
0
0

What is the purpose of the <?php ?> tags in a PHP file?

easy📝 Conceptual Q1 of 15
PHP - Basics and Execution Model
What is the purpose of the <?php ?> tags in a PHP file?
AThey mark the start and end of PHP code inside a file
BThey are used to print text on the screen
CThey comment out the PHP code
DThey declare a variable in PHP
Step-by-Step Solution
Solution:
  1. Step 1: Understand PHP tags usage

    The <?php ?> tags tell the server where PHP code begins and ends.
  2. Step 2: Differentiate from other options

    Printing text uses echo, commenting uses // or /* */, and variables use $ sign, not tags.
  3. Final Answer:

    They mark the start and end of PHP code inside a file -> Option A
  4. Quick Check:

    PHP tags = mark code block [OK]
Quick Trick: PHP code must be inside tags [OK]
Common Mistakes:
  • Confusing tags with echo statement
  • Thinking tags are comments
  • Using tags to declare variables

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes