Bird
0
0

Which of the following is the correct way to start a PHP script in a file?

easy📝 Syntax Q12 of 15
PHP - Basics and Execution Model
Which of the following is the correct way to start a PHP script in a file?
A<code><?php</code>
B<code><script></code>
C<code><php></code>
D<code><?></code>
Step-by-Step Solution
Solution:
  1. Step 1: Recall PHP opening tags

    The standard way to start PHP code is with <?php tag.
  2. Step 2: Check other options

    <script> is for JavaScript, <php> is invalid, and <?> is incomplete.
  3. Final Answer:

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

    PHP scripts start with <?php [OK]
Quick Trick: PHP scripts always start with <?php tag [OK]
Common Mistakes:
  • Using JavaScript tags instead of PHP tags
  • Omitting 'php' after the opening tag
  • Using invalid tags like

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes