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] => peach [1] => pear [2] => orange ) Array ( [0] => peach ) Array ( [0] => apple [1] => mango [2] => peach ) Array ( [0] => apple [1] => mango ) 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/>print_r(array_merge($a1, $a2)); Array ( [0] => red [1] => green [2] => blue [3] => yellow ) Array ( [0] => blue [1] => yellow [2] => red [3] => green ) 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 ("mango", "apple", "peach", "pear");<br/>$fruits = asort ($fruits);<br/>printr ($fruits); Array ( [0] => apple [1] => mango [2] => peach [3] => pear ) Array ( [1] => apple [0] => mango [2] => peach [3] => pear ) Array ( [1] => apple [0] => mango [3] => peach [2] => pear ) Error TRUE ANSWER : ? YOUR ANSWER : ?
What array will you get if you convert an object to an array? An array with keys of that object as the array's elements An array with properties of that array as the object's elements An array with properties of that object as the array's elements An array with properties of that object as the Key elements TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code ?<br/>$a = array("a" => "Jaguar", "b" => "Land Rover", "c" => "Audi", "d" => "Maseratti");<br/>echo array_search("Audi", $a); b a c d 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”); 2, 3 and 4 Only 1 2 and 3 3 and 4 TRUE ANSWER : ? YOUR ANSWER : ?
Which array function checks if the specified key exists in the array? array_key_exist() array_key_exists() array_keys_exists() arrays_key_exists() 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 functions count elements in an array?<br/>1. count<br/>2. Sizeof<br/>3. Array_Count<br/>4. Count_array Option 1 and 2 Option 1 and 4 Option 2 and 4 Option 3 and 4 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) Error Sam is the brother of Bob and Bob) $brother $brother TRUE ANSWER : ? YOUR ANSWER : ?