Bird
0
0

Find the mistake in this PHP code snippet:

medium📝 Debug Q7 of 15
PHP - String Functions
Find the mistake in this PHP code snippet:
$text = "HELLO WORLD";
echo strtolower $text;
AVariable name is incorrect
Bstrtolower cannot be used on uppercase strings
CMissing parentheses after strtolower
DMissing semicolon after echo
Step-by-Step Solution
Solution:
  1. Step 1: Analyze function call syntax

    Functions in PHP require parentheses around arguments, so strtolower $text is invalid.
  2. Step 2: Check other syntax elements

    Variable name is correct, strtolower works on uppercase strings, and semicolon is present.
  3. Final Answer:

    Missing parentheses after strtolower -> Option C
  4. Quick Check:

    Function call syntax requires parentheses [OK]
Quick Trick: Always use parentheses when calling functions [OK]
Common Mistakes:
  • Omitting parentheses in function calls
  • Misnaming variables
  • Thinking function can't handle uppercase

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes