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] => red [1] => green [2] => blue [3] => yellow ) Array ( [0] => blue [1] => yellow [2] => red [3] => green ) TRUE ANSWER : ? YOUR ANSWER : ?
What elements will the following script output?<br/>$array = array (true => 'a', 1 => 'b');<br/>var_dump ($array); 1 => 'b' True => 'a', 1 => 'b' It will output NULL None 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 ) Array ( [0] => apple [1] => mango [2] => peach ) Array ( [0] => peach ) Array ( [0] => peach [1] => pear [2] => orange ) 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] => 1 [Cat] => 1 [Dog] => 2 ) Array ( [A] => 2 [Cat] => 1 [Dog] => 2 ) Array ( [A] => 2 [Cat] => 2 [Dog] => 1 ) 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 : ?
Which function will return true if a variable is an array or false if it is not? is_array() in_array() do_array() this_array() TRUE ANSWER : ? YOUR ANSWER : ?
What function computes the difference of arrays? diff_array arrays_diff diff_arrays array_diff TRUE ANSWER : ? YOUR ANSWER : ?
Array values are keyed by ______ values (called indexed arrays) or using ______ values (called associative arrays). Of course, these key methods can be combined as well. String, Boolean Even number, string Integer, string Positive number, negative number Float, string 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, Toyota and BMW I like BMW, Volvo and Toyota I like Volvo, BMW and Toyota TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$array1 = array ("KA", "LA", "CA", "MA", "TA");<br/>$array2 = array ("KA", "IA", "CA", "GA", "TA");<br/>$inter = array_intersect ($array1, $array2);<br/>print_r ($inter); Array ( [1] => LA [3] => MA ) Array ( [0] => KA [2] => CA [4] => TA ) Array ( [0] => KA [1] => LA [2] => CA [3] => MA [4] => TA [5] => IA [6] => GA ) Array ( [1] => IA [3] => GA ) TRUE ANSWER : ? YOUR ANSWER : ?