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 ) Array ( [0] => red [1] => green ) Array ( [0] => blue [1] => yellow [2] => red [3] => green ) Array ( [0] => red [1] => green [2] => blue [3] => yellow ) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$arr = array ("picture1.JPG", "picture2.jpg", "Picture10.jpg", "picture20.jpg");<br/>sort($arr);<br/>print_r($arr); Array ( [0] => picture1.JPG [1] => Picture10.jpg [2] => picture2.jpg [3] => picture20.jpg ) Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture20.jpg [3] => picture2.jpg ) Array ( [0] => picture1.JPG [1] => picture2.jpg [2] => Picture10.jpg [3] => picture20.jpg ) Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture2.jpg [3] => picture20.jpg ) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$a = array("A", "Cat", "Dog", "A", "Dog");<br/>print_r(array_count_values($a)); Array ( [A] => 2 [Cat] => 1 [Dog] => 1) Array ( [A] => 2 [Cat] => 2 [Dog] => 1 ) Array ( [A] => 1 [Cat] => 1 [Dog] => 2 ) Array ( [A] => 2 [Cat] => 1 [Dog] => 2 ) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$a = array("red", "green", "blue");<br/>array_pop($a);<br/>print_r($a); Array ( [0] => blue [1] => blue ) Array ( [0] => red [1] => green ) Array ( [0] => green [1] => blue ) Array ( [0] => red [1] => blue ) 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; Error Sam is the brother of Bob and Bob) $brother Sam is the brother of Bob and Bob) $brother 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; 78 NULL 5 19 TRUE ANSWER : ? YOUR ANSWER : ?
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 ( [1] => apple [0] => mango [3] => peach [2] => pear ) Array ( [1] => apple [0] => mango [2] => peach [3] => pear ) Error Array ( [0] => apple [1] => mango [2] => peach [3] => pear ) 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 Volvo, BMW and Toyota I like BMW, Volvo and Toyota I like Volvo, Toyota and BMW I like Toyota, BMW and Volvo 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 ( [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 ) Array ( [a] => red [b] => green [c] => blue [d] => yellow ) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$fruits = array ("mango", "apple", "pear", "peach");<br/>$fruits = array_flip($fruits);<br/>echo ($fruits[0]); error 0 peach mango TRUE ANSWER : ? YOUR ANSWER : ?