What will be the output of the following PHP code?<br/>$fruits = array ("apple", "mango", "peach", "pear", "orange");<br/>$subset = array_splice ($fruits, 2);<br/>print_r ($fruits); Error Array ( [0] => apple [1] => mango ) Array ( [0] => pear [1] => orange ) Array ( [0] => apple [1] => mango [2] => peach ) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code ?<br/>$number = range(0, 5);<br/>print_r ($number); Array ( [0] => 0 [5] => 5 ) Array ( [0] => 5 [1] => 5 [2] => 5 [3] => 5 [4] => 5 [5] => 5 ) Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 ) Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 ) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code ?<br/>$age = array("Harry" => "21", "Ron" => "23","Malfoy" => "21");<br/>array_change_key_case($age, CASE_UPPER);<br/>array_pop($age);<br/>print_r($age); Array ( [HARRY] => 21 [RON] => 23 [MALFOY] => 21 ) Array ( [Harry] => 21 [Ron] => 23 [Malfoy] => 21 ) Array ( [Harry] => 21 [Ron] => 23 ) Array ( [HARRY] => 21 [RON] => 23 ) TRUE ANSWER : ? YOUR ANSWER : ?
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? usort() asort() ksort() sort() krsort() TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code ?<br/>$a = array(12, 5, 2);<br/>echo(array_product($a)); 060 010 120 024 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$a = array("a"=>"red", "b"=>"green", "c"=>"blue");<br/>echo array_shift($a);<br/>print_r ($a); red none of the mentioned blue green TRUE ANSWER : ? YOUR ANSWER : ?
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; 5 78 19 NULL 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. Positive number, negative number String, Boolean Even number, string Float, string Integer, string TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$a1 = array("a"=>"red", "b"=>"green", "c"=>"blue", "d"=>"yellow");<br/>$a2 = array("e"=>"red", "f"=>"green", "g"=>"blue");<br/>$result = array_diff($a1, $a2);<br/>print_r($result); Array ( [d] => yellow ) Array ( [c] => blue ) Array ( [a] => red ) Array ( [e] => yellow ) TRUE ANSWER : ? YOUR ANSWER : ?