What will be the output of the following PHP code?<br/>$fruits = array ("mango", "apple", "peach", "pear");<br/>$fruits = asort ($fruits);<br/>printr ($fruits); Array ( [0] => apple [1] => mango [2] => peach [3] => pear ) Array ( [1] => apple [0] => mango [2] => peach [3] => pear ) Error Array ( [1] => apple [0] => mango [3] => peach [2] => pear ) TRUE ANSWER : ? YOUR ANSWER : ?
What functions count elements in an array?<br/>1. count<br/>2. Sizeof<br/>3. Array_Count<br/>4. Count_array Option 1 and 4 Option 3 and 4 Option 2 and 4 Option 1 and 2 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", "h" => "orange");<br/>$a3 = array("i" => "orange");<br/>$a4 = array_combine($a2, $a3);<br/>$result = array_diff($a4, $a2);<br/>print_r($result); Array ( [d] => yellow [h] => orange ) Array ( [d] => yellow ) Array ( [i] => orange ) Array ( [h] => orange ) 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; NULL 78 19 5 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($fname, $age);<br/>print_r($c); Array ( Peter Ben Joe ) Array ( 35 37 43 ) Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 ) Array ( “[Peter] => 35” “[Ben] => 37” “[Joe] => 43” ) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$cars = array("Volvo", "BMW", "Toyota");<br/>echo "I like " . $cars[2] . ", " . $cars[1] . " and " . $cars[0] . "."; I like Toyota, BMW and Volvo I like BMW, Volvo and Toyota I like Volvo, BMW and Toyota I like Volvo, Toyota and BMW TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code ?<br/>$array = array("red", "green");<br/>array_push($array, "blue", "yellow");<br/>print_r($array); Array ( [0] => blue [1] => yellow [2] => red [3] => green ) Array ( [0] => blue [1] => yellow ) Array ( [0] => red [1] => green [2] => blue [3] => yellow ) Array ( [0] => red [1] => green ) 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? ksort() usort() krsort() sort() asort() TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code ?<br/>$people = array("Peter", "Susan", "Edmund", "Lucy");<br/>echo pos($people); Susan Lucy Peter Edmund TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code ?<br/>$a = array("a" => "Jaguar", "b" => "Land Rover", "c" => "Audi", "d" => "Maseratti");<br/>echo array_search("Audi", $a); c a d b TRUE ANSWER : ? YOUR ANSWER : ?