?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "My car is a {$cars[0]}";
?>
<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "My car is a {$cars[0]}";
?>
Answer & Solution
Correct Answer:
Option
A
In the echo statement the {$cars[0]} is replaced by the 1st element in cars that is Volvo.
Join the Discussion
Login to post a comment or share your explanation.
Login