Arrays - Study Mode
[#1] 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.
Correct Answer
Float, string
[#2] Which array function checks if the specified key exists in the array?
Correct Answer
(B) array_key_exists()
[#3] There are three different kind of arrays:
Correct Answer
(C) Numeric array, Associative array, Multidimensional array
[#4] 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?
Correct Answer
Yes, because the interpreter must always create a copy of the array before passing it to the function.
[#5] 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?
Correct Answer
(B) asort()