PHP Arrays Which of the following are correct ways of creating an array?1. state[0] = “karnataka”;2. $state[] = array(“karnataka”);3. $state[0] = “karnataka”;4. $state = array(“karnataka”); 2 and 3 2, 3 and 4 3 and 4 Only 1 2 and 3 2, 3 and 4 3 and 4 Only 1 ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays What will be the output of the following PHP code?$fname = array("Peter", "Ben", "Joe");$age = array("35", "37", "43");$c = array_combine($age, $fname);print_r($c); Array ( Peter Ben Joe ) Array ( [35] => Peter [37] => Ben [43] => Joe ) Array ( 35 37 43 ) Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 ) Array ( Peter Ben Joe ) Array ( [35] => Peter [37] => Ben [43] => Joe ) Array ( 35 37 43 ) Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 ) 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] => red [b] => green [c] => blue [d] => yellow ) Array ( [red] => red [green] => green [blue] => blue [yellow] => yellow ) Array ( [a] => a [b] => b [c] => c [d] => d ) Array ( [red] => a [green] => b [blue] => c [yellow] => d ) Array ( [a] => red [b] => green [c] => blue [d] => yellow ) Array ( [red] => red [green] => green [blue] => blue [yellow] => yellow ) Array ( [a] => a [b] => b [c] => c [d] => d ) ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays What will be the output of the following PHP code?$cars = array("Volvo", "BMW", "Toyota");echo "I like " . $cars[2] . ", " . $cars[1] . " and " . $cars[0] . "."; I like BMW, Volvo and Toyota I like Volvo, BMW and Toyota I like Toyota, BMW and Volvo I like Volvo, Toyota and BMW I like BMW, Volvo and Toyota I like Volvo, BMW and Toyota I like Toyota, BMW and Volvo I like Volvo, Toyota and BMW ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays Which function returns an array consisting of associative key/value pairs? array_count() count_values() count() array_count_values() array_count() count_values() count() array_count_values() ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays What will be the output of the following PHP code?$a = array("a"=>"red", "b"=>"green", "c"=>"blue");echo array_shift($a);print_r ($a); green none of the mentioned blue red green none of the mentioned blue red ANSWER DOWNLOAD EXAMIANS APP