Bird
0
0

Which PHP tag syntax ensures that variables are initialized fresh every time the script runs?

easy📝 Syntax Q3 of 15
PHP - Request Lifecycle
Which PHP tag syntax ensures that variables are initialized fresh every time the script runs?
A<script> ... </script>
B<?php ... ?>
C<? ... ?> without php
D<!-- PHP code -->
Step-by-Step Solution
Solution:
  1. Step 1: Identify PHP tags

    PHP scripts must start with <?php and end with ?> to execute properly.
  2. Step 2: Understand variable reset

    Each time the script runs, variables inside these tags are reinitialized.
  3. Final Answer:

    <?php ... ?> -> Option B
  4. Quick Check:

    PHP tags define script boundaries [OK]
Quick Trick: Use <?php ... ?> tags for fresh variable initialization [OK]
Common Mistakes:
  • Using HTML script tags instead of PHP tags
  • Omitting 'php' in the opening tag
  • Using HTML comments to enclose PHP code

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes