Bird
0
0

Identify the error in this PHP code:

medium📝 Debug Q7 of 15
PHP - Basics and Execution Model
Identify the error in this PHP code:
<?php
echo 'Hello World!";
?>
AMismatched quotes around string
BMissing semicolon
CIncorrect echo syntax
DPHP tags not closed
Step-by-Step Solution
Solution:
  1. Step 1: Check string quotes

    The string starts with single quote but ends with double quote, causing mismatch.
  2. Step 2: Confirm other syntax

    Semicolon and PHP tags are present; echo syntax is correct otherwise.
  3. Final Answer:

    Mismatched quotes around string -> Option A
  4. Quick Check:

    Quotes must match [OK]
Quick Trick: Use matching quotes for strings [OK]
Common Mistakes:
  • Mixing single and double quotes
  • Forgetting semicolon
  • Not closing PHP tags

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes