PHP Arrays What will be the output of the following PHP code?$names = array("Sam", "Bob", "Jack");echo $names[0] . "is the brother of " . $names[1] . " and " . $names[1] . ".".$brother; Sam is the brother of Bob and Bob) $brother Sam is the brother of Bob and Bob) $brother Error Sam is the brother of Bob and Bob) $brother Sam is the brother of Bob and Bob) $brother Error ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays There are three different kind of arrays: Numeric array, Associative array, Dimensional array Numeric array, Associative array, Multidimensional array Numeric array, String array, Multidimensional array Const array, Associative array, Multidimensional array Numeric array, Associative array, Dimensional array Numeric array, Associative array, Multidimensional array Numeric array, String array, Multidimensional array Const array, Associative array, Multidimensional array ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays What will be the output of the following PHP code?$a=array("A","Cat","Dog","A","Dog");$b=array("A","A","Cat","A","Tiger");$c=array_combine($a,$b);print_r(array_count_values($c)); Array ( [A] => 6 [Cat] => 1 [Dog] => 2 [Tiger] => 1 ) Array ( [A] => 5 [Cat] => 2 [Dog] => 2 [Tiger] => 1 ) Array ( [A] => 2 [Cat] => 1 [Dog] => 4 [Tiger] => 1 ) Array ( [A] => 2 [Cat] => 2 [Dog] => 1 [Tiger] => 1 ) Array ( [A] => 6 [Cat] => 1 [Dog] => 2 [Tiger] => 1 ) Array ( [A] => 5 [Cat] => 2 [Dog] => 2 [Tiger] => 1 ) Array ( [A] => 2 [Cat] => 1 [Dog] => 4 [Tiger] => 1 ) Array ( [A] => 2 [Cat] => 2 [Dog] => 1 [Tiger] => 1 ) ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays What will be the output of the following PHP code?$a1 = array("a"=>"red", "b"=>"green", "c"=>"blue", "d"=>"yellow");$a2 = array("e"=>"red", "f"=>"green", "g"=>"blue");$result = array_diff($a1, $a2);print_r($result); Array ( [e] => yellow ) Array ( [c] => blue ) Array ( [d] => yellow ) Array ( [a] => red ) Array ( [e] => yellow ) Array ( [c] => blue ) Array ( [d] => yellow ) Array ( [a] => red ) ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays What will be the output of the following PHP code ?$a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow");$result = array_flip($a1);print_r($result); Array ( [red] => a [green] => b [blue] => c [yellow] => d ) Array ( [a] => a [b] => b [c] => c [d] => d ) Array ( [red] => red [green] => green [blue] => blue [yellow] => yellow ) Array ( [a] => red [b] => green [c] => blue [d] => yellow ) Array ( [red] => a [green] => b [blue] => c [yellow] => d ) Array ( [a] => a [b] => b [c] => c [d] => d ) Array ( [red] => red [green] => green [blue] => blue [yellow] => yellow ) Array ( [a] => red [b] => green [c] => blue [d] => yellow ) ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays What will be the output of the following PHP code ?$a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow");$a2 = array("e" => "red","f" => "green", "g" => "blue");$result = array_intersect($a1, $a2);print_r($result); Array ( [e] => red [f] => green [g] => blue ) Array ( [a] => red [b] => green [c] => blue [d] => yellow ) Array ( [a] => red [b] => green [c] => blue ) Array ( [a] => red [b] => green [c] => blue [d] => yellow [e] => red [f] => green [g] => blue ) Array ( [e] => red [f] => green [g] => blue ) Array ( [a] => red [b] => green [c] => blue [d] => yellow ) Array ( [a] => red [b] => green [c] => blue ) Array ( [a] => red [b] => green [c] => blue [d] => yellow [e] => red [f] => green [g] => blue ) ANSWER DOWNLOAD EXAMIANS APP