Shortcut Navigation:

PHP Array Array Quiz

Array values are keyed by ______ values (called indexed arrays) or using ______ values (called associative arrays). Of course, these key methods can be combined as well.

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;
?>

What elements will the following script output? 
<?php
$array = array (true => 'a', 1 => 'b');
var_dump ($array);
?>

Which array function checks if the specified key exists in the array

There are three different kind of arrays:

Absent any actual need for choosing one method over the other, does passing arrays by value to a read-only function reduce performance compared to passing them by reference?

Assume you would like to sort an array in ascending order by value while preserving key associations. Which of the following PHP sorting functions would you use?

What function computes the difference of arrays?

What functions count elements in an array?

What array will you get if you convert an object to an array?