What will be the output of the following PHP code?<br/>$a1 = array("red", "green");<br/>$a2 = array("blue", "yellow");<br/>print_r(array_merge($a1, $a2)); Array ( [0] => blue [1] => yellow [2] => red [3] => green ) Array ( [0] => red [1] => green [2] => blue [3] => yellow ) Array ( [0] => blue [1] => yellow ) Array ( [0] => red [1] => green) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$fruits = array ("apple", "orange", array ("pear", "mango"), "banana");<br/>echo (count($fruits, 1)); 6 5 3 4 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] => 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 ) Array ( [A] => 2 [Cat] => 2 [Dog] => 1 [Tiger] => 1 ) 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() sort() krsort() asort() TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$array1 = array ("KA", "LA", "CA", "MA", "TA");<br/>$array2 = array ("KA", "IA", "CA", "GA", "TA");<br/>$inter = array_intersect ($array1, $array2);<br/>print_r ($inter); Array ( [0] => KA [2] => CA [4] => TA ) Array ( [1] => LA [3] => MA ) Array ( [1] => IA [3] => GA ) Array ( [0] => KA [1] => LA [2] => CA [3] => MA [4] => TA [5] => IA [6] => GA ) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$place = array("NYC", "LA", "Paris");<br/>array_pop($place);<br/>$place1 = array("Paris");<br/>$place = array_merge($place, $place1);<br/>print_r($place); Array ( [0] => NYC [1] => LA [2] => Paris [3] => Paris ) Array ( [0] => LA [1] => Paris [2] => Paris ) Array ( [0] => NYC [1] => LA [2] => Paris) None of the mentioned TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$face = array ("A", "J", "Q", "K");<br/>$number = array ("2","3","4", "5", "6", "7", "8", "9", "10");<br/>$cards = array_merge ($face, $number);<br/>print_r ($cards); Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 5 [4] => 6 [5] => 7 [6] => 8 [7] => 9 [8] => 10 [9] => A [10] => J [11] => Q [12] => K ) Array ( [0] => A [1] => J [2] => Q [3] => K [4] => 2 [5] => 3 [6] => 4 [7] => 5 [8] => 6 [9] => 7 [10] => 8 [11] => 9 [12] => 10 ) Array ( [0] => A [1] => 2 [2] => J [3] => 3 [4] => Q [5] => 4 [6] => K [7] => 5 [8] => 6 [9] => 7 [10] => 8 [11] => 9 [12] => 10 ) Error TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$state = array ("Karnataka", "Goa", "Tamil Nadu", "Andhra Pradesh");<br/>echo (array_search ("Tamil Nadu", $state) ); 2 False True 1 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$names = array("Sam", "Bob", "Jack");<br/>echo $names[0] . "is the brother of " . $names[1] . " and " . $names[1] . ".".$brother; Sam is the brother of Bob and Bob) $brother Error Sam is the brother of Bob and Bob) $brother TRUE ANSWER : ? YOUR ANSWER : ?
Which function can be used to move the pointer to the previous array position? previous() last() before() prev() TRUE ANSWER : ? YOUR ANSWER : ?