What will the following script output?<br/>$array = array (1, 2, 3, 5, 8, 13, 21, 34, 55);<br/>$sum = 0;<br/>for ($i = 0; $i < 5; $i++) {<br/>$sum += $array[$array[$i]];<br/>}<br/>echo $sum; 19 NULL 5 78 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$fname = array("Peter", "Ben", "Joe");<br/>$age = array("35", "37", "43");<br/>$c = array_combine($age, $fname);<br/>print_r($c); Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 ) Array ( 35 37 43 ) Array ( Peter Ben Joe ) Array ( [35] => Peter [37] => Ben [43] => Joe ) TRUE ANSWER : ? YOUR ANSWER : ?
Which function can be used to move the pointer to the previous array position? before() prev() previous() last() TRUE ANSWER : ? YOUR ANSWER : ?
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? No Yes, because the interpreter must always create a copy of the array before passing it to the function. Yes, but only if the array is large. Yes, because PHP must monitor the execution of the function to determine if changes are made to the array. Yes, but only if the function modifies the contents of the array. TRUE ANSWER : ? YOUR ANSWER : ?
Which in-built function will add a value to the end of an array? array_unshift() into_array() inend_array() array_push() TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$a=array("A","Cat","Dog","A","Dog");<br/>$b=array("A","A","Cat","A","Tiger");<br/>$c=array_combine($a,$b);<br/>print_r(array_count_values($c)); Array ( [A] => 2 [Cat] => 2 [Dog] => 1 [Tiger] => 1 ) Array ( [A] => 5 [Cat] => 2 [Dog] => 2 [Tiger] => 1 ) Array ( [A] => 6 [Cat] => 1 [Dog] => 2 [Tiger] => 1 ) Array ( [A] => 2 [Cat] => 1 [Dog] => 4 [Tiger] => 1 ) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$fruits = array ("apple", "mango", "peach", "pear", "orange");<br/>$subset = array_slice ($fruits, 2);<br/>print_r ($subset); Array ( [0] => apple [1] => mango [2] => peach ) Array ( [0] => apple [1] => mango ) Array ( [0] => peach [1] => pear [2] => orange ) Array ( [0] => peach ) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$a1 = array("red", "green");<br/>$a2 = array("blue", "yellow");<br/>$a3 = array_merge($a1, $a2);<br/>$a4 = array("a", "b", "c", "d");<br/>$a = array_combine($a4, $a3);<br/>print_r($a); Array ( [0] => blue [1] => yellow [2] => red [3] => green ) Array ( [0] => red [1] => green [2] => blue [3] => yellow ) Array ( [a] => red [b] => green [c] => blue [d] => yellow ) Array ( [a] => blue [b] => yellow [c] => red [d] => green ) TRUE ANSWER : ? YOUR ANSWER : ?
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. Float, string String, Boolean Even number, string Positive number, negative number Integer, string TRUE ANSWER : ? YOUR ANSWER : ?
Which array function checks if the specified key exists in the array? array_key_exists() array_keys_exists() array_key_exist() arrays_key_exists() TRUE ANSWER : ? YOUR ANSWER : ?