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 NULL 19 78 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 Volvo, BMW and Toyota I like BMW, Volvo and Toyota I like Volvo, Toyota and BMW TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$fruits = array ("apple", "mango", "peach", "pear", "orange");<br/>$subset = array_slice ($fruits, 2);<br/>print_r ($subset); Array ( [0] => apple [1] => mango [2] => peach ) Array ( [0] => apple [1] => mango ) Array ( [0] => peach [1] => pear [2] => orange ) Array ( [0] => peach ) 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/>$city_west = array("NYC", "London");<br/>$city_east = array("Mumbai", "Beijing");<br/>print_r(array_replace($city_west, $city_east)); Array ( [1] => NYC [0] => London ) Array ( [0] => Mumbai [1] => Beijing ) Array ( [0] => NYC [1] => London ) Array ( [1] => Mumbai [0] => Beijing ) 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 : ?
What will be the output of the following PHP code?<br/>$number = array ("4", "hello", 2);<br/>echo (array_sum ($number)); 4hello2 2 4 6 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 Edmund Peter TRUE ANSWER : ? YOUR ANSWER : ?
What function computes the difference of arrays? diff_arrays diff_array array_diff arrays_diff 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] => 2 [Dog] => 1 ) Array ( [A] => 2 [Cat] => 1 [Dog] => 1) Array ( [A] => 1 [Cat] => 1 [Dog] => 2 ) Array ( [A] => 2 [Cat] => 1 [Dog] => 2 ) TRUE ANSWER : ? YOUR ANSWER : ?