Discussion :: PHP MCQs
-
What will be the output of the following PHP code?
< ?php $color = "maroon"; $var = $color[2]; echo "$var" ; ?>
Answer : Option D
Explanation :
PHP treats strings in the same fashion as arrays, allowing for specific characters to be accessed via array offset notation.
Be The First To Comment