Q. What is the result of the following PHP code?
Code:
<?php
$array = array (1, 2, 3, 4, 1);
$sum = 0;
for ($i = 0; $i < 4; $i++) {
$sum += $array[$array[$i]];
}
echo $sum;
?>
β
Correct Answer: (B)
10