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 ( [0] => NYC [1] => London ) Array ( [1] => Mumbai [0] => Beijing ) Array ( [1] => NYC [0] => London ) Array ( [0] => Mumbai [1] => Beijing ) TRUE ANSWER : ? YOUR ANSWER : ?
Which function will return true if a variable is an array or false if it is not? this_array() do_array() is_array() in_array() 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/>$result = array_flip($a1);<br/>print_r($result); Array ( [red] => a [green] => b [blue] => c [yellow] => d ) Array ( [red] => red [green] => green [blue] => blue [yellow] => yellow ) Array ( [a] => a [b] => b [c] => c [d] => 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/>$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 ( [h] => orange ) Array ( [d] => yellow [h] => orange ) Array ( [d] => yellow ) Array ( [i] => orange ) 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 Toyota, BMW and Volvo I like Volvo, Toyota and BMW I like BMW, Volvo and Toyota TRUE ANSWER : ? YOUR ANSWER : ?
Which function can be used to move the pointer to the previous array position? prev() previous() last() before() TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$a1 = array("red", "green");<br/>$a2 = array("blue", "yellow");<br/>$a3 = array_merge($a1, $a2);<br/>$a4 = array("a", "b", "c", "d");<br/>$a = array_combine($a4, $a3);<br/>print_r($a); Array ( [a] => red [b] => green [c] => blue [d] => yellow ) Array ( [0] => red [1] => green [2] => blue [3] => yellow ) Array ( [0] => blue [1] => yellow [2] => red [3] => green ) Array ( [a] => blue [b] => yellow [c] => red [d] => green ) 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; $brother Sam is the brother of Bob and Bob) $brother Sam is the brother of Bob and Bob) Error TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$fruits = array ("apple", "orange", "banana");<br/>echo (next($fruits));<br/>echo (next($fruits)); appleapple orangebanana appleorange orangeorange TRUE ANSWER : ? YOUR ANSWER : ?