Bird
0
0

Which of the following correctly ends a PHP block?

easy📝 Syntax Q12 of 15
PHP - Request Lifecycle
Which of the following correctly ends a PHP block?
A<code>?></code>
B<code></php></code>
C<code><?php</code>
D<code><?></code>
Step-by-Step Solution
Solution:
  1. Step 1: Identify PHP closing tag

    The PHP block ends with ?> to signal the end of PHP code.
  2. Step 2: Validate other options

    </php> is invalid HTML, <?php starts PHP, and <?> is not a valid closing tag.
  3. Final Answer:

    ?> -> Option A
  4. Quick Check:

    PHP ends with ?> [OK]
Quick Trick: PHP ends with ?> tag to close code block [OK]
Common Mistakes:
  • Using HTML closing tags like
  • Confusing PHP start and end tags
  • Omitting the closing tag when mixing PHP and HTML

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes