Examveda
Examveda

What will the following script output?
<?php
$array = array (1, 2, 3, 5, 8, 13, 21, 34, 55);
$sum = 0;
for ($i = 0; $i < 5; $i++) {
$sum += $array[$array[$i]];
}
echo $sum;
?>

A. 78

B. 19

C. NULL

D. 5

Answer: Option A


This Question Belongs to PHP >> Arrays

Join The Discussion

Comments ( 1 )

  1. Akash Jadhav
    Akash Jadhav :
    4 years ago

    where is script?

Related Questions on Arrays