Chapter 1 5
Chapter 1 5
1. — Creates an array by using one array for keys and another for its values
A. Array_Splice
B. . array_combine
C. Array_Fill()
Ans: B
3. Which function use to remove a portion of the array and replace it with something else
A. Array_Splice
B. array_combine
C. Array_Fill()
Ans: A
8. How to searches the array for a given value and returns the corresponding key if successfully?
A. Array_in()
B. Search()
C. Array_Search()
Ans: C
9. <?php
$stack = array("orange", "banana", "apple", "raspberry");
$fruit = array_pop($stack);
print_r($stack);
?>
What will be the output?
A. [0] => orange [1] => banana [2] => apple
B. [0] => orange [1] => banana [2] => raspberry
C. [0] => raspberry [1] => banana [2] => apple
Ans: A
10. <?php
$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));
?>
What will be the output?
A. [0] => XL [1] => gold [2]=>Size
B. [0] => XL [1] => gold
Ans: B
11. ksort— Sort an array with a user-defined comparison function and maintain index association
A. True
B. False
Ans: B
12. ________Return the current key and value pair from an array and advance the array cursor.
A. Prev
B. Next
C. Last
D. Each
Ans: D
13. Which construct used to make simultaneously variable assignments from values extracted from an array?
A. Array_list()
B. list ()
C. list_array()
Ans: B
14. A key may be either an integer or a string. If a key is the standard representation of an integer
A. True
B. False
Ans: A