Single Choice
Not Set
QWhat will be the output of the following PHP code?
< ?php
$color = "maroon";
$var = $color[2];
echo "$var" ;
?>
ID: #2359
PHP Basic MCQ
1,794 views
Question Info
#2359Q ID
Not SetDifficulty
PHP Basic MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
PHP treats strings in the same fashion as arrays, allowing for specific characters to be accessed via array offset notation.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic