MCQ
MCQ
<?php
$a = array(16, 5, 2);
echo array_product($a);
?>
a. 32
b. 80
c. 1652
d. 160
12. The … function returns an array consisting of all keys located in an array.
A) keys_array()
B) array_keys()
C) array_search()
D) array_key_exists()
13. The … function returns all values located in an array, automatically providing
numeric indexes for the returned array.
A) numeric_array()
B) array_indexes()
C) array_search()
D) array_values()
14. The … function returns the key located at the current pointer position of the
provided array.
A) key()
B) current_key()
C) array_search()
D) current_key_exists()
15. The … function returns the array value residing at the current pointer position of
the array.
A) current()
B) current_key()
C) each_key()
D) current_key_exists()
a. # (Hash)
b. & (Ampersand)
c. $ (Dollar)
d. ! (Exclamation)
17. The … function returns the array value residing at the position immediately
following that of the current array pointer.
A) current()
B) current_array()
C) next_array()
D) next()
18. The … function returns the array value residing at the location preceding the
current pointer location, or FALE if the pointer resides at the first position in the
array.
A) reset()
B) preceding_array()
C) prev_array()
D) prev()
19. … is used when you need to review or manipulate an array multiple times within
a script.
A) review()
B) reset_array()
C) reset()
D) manipulate()
20. The function moves the pointer to the last position of an array.
A) end_array()
B) last_array()
C) end()
D) last()
1. D) i-True, ii-False, iii-True
2. B) is_array()
3. C) i and iii only
4. A) print_r
5. C) array_unshift()
6. A) array_push()
7. B) array_shift()
8. C) array_pop()
9. B) in_array()
10. D) array_key_exists()
11. D) 160
12. B) array_keys()
13. D) array_values()
14. A) key()
15. A) current()
16. C) $(dollar)
17. D) next()
18. D) prev()
19. C) reset()
20. C) end()