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] => 2 [Cat] => 1 [Dog] => 4 [Tiger] => 1 ) Array ( [A] => 2 [Cat] => 2 [Dog] => 1 [Tiger] => 1 ) Array ( [A] => 6 [Cat] => 1 [Dog] => 2 [Tiger] => 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] . "."; Error Sam is the brother of Bob and Jack Sam is the brother of Bob and Bob) Sam is the brother of Jack and Bob) 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/>$result = array_flip($a1);<br/>print_r($result); Array ( [a] => a [b] => b [c] => c [d] => d ) Array ( [red] => red [green] => green [blue] => blue [yellow] => yellow ) Array ( [red] => a [green] => b [blue] => c [yellow] => d ) Array ( [a] => red [b] => green [c] => blue [d] => yellow ) 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 ) Array ( [HARRY] => 21 [RON] => 23 [MALFOY] => 21 ) Array ( [Harry] => 21 [Ron] => 23 [Malfoy] => 21 ) Array ( [Harry] => 21 [Ron] => 23 ) 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_intersect($a1, $a2);<br/>print_r($result); Array ( [a] => red [b] => green [c] => blue ) Array ( [e] => red [f] => green [g] => blue ) Array ( [a] => red [b] => green [c] => blue [d] => yellow [e] => red [f] => green [g] => blue ) Array ( [a] => red [b] => green [c] => blue [d] => yellow ) 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] => LA [1] => Paris [2] => Paris ) None of the mentioned Array ( [0] => NYC [1] => LA [2] => Paris) Array ( [0] => NYC [1] => LA [2] => Paris [3] => Paris ) TRUE ANSWER : ? YOUR ANSWER : ?
Which in-built function will add a value to the end of an array? into_array() array_unshift() array_push() inend_array() 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] => 35” “[Ben] => 37” “[Joe] => 43” ) Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 ) Array ( Peter Ben Joe ) Array ( 35 37 43 ) TRUE ANSWER : ? YOUR ANSWER : ?
Which of the following are correct ways of creating an array?<br/>1. state[0] = “karnataka”;<br/>2. $state[] = array(“karnataka”);<br/>3. $state[0] = “karnataka”;<br/>4. $state = array(“karnataka”); 3 and 4 2 and 3 2, 3 and 4 Only 1 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 3 and 4 Option 2 and 4 Option 1 and 4 Option 1 and 2 TRUE ANSWER : ? YOUR ANSWER : ?