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”); 3 and 4 2, 3 and 4 2 and 3 Only 1 3 and 4 2, 3 and 4 2 and 3 Only 1 ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays What will be the output of the following PHP code?$number = array ("4", "hello", 2);echo (array_sum ($number)); 2 4 6 4hello2 2 4 6 4hello2 ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays What will the following script output?$array = array (1, 2, 3, 5, 8, 13, 21, 34, 55);$sum = 0;for ($i = 0; $i < 5; $i++) {$sum += $array[$array[$i]];}echo $sum; 19 78 NULL 5 19 78 NULL 5 ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays What will be the output of the following PHP code?$fruits = array ("apple", "orange", array ("pear", "mango"), "banana");echo (count($fruits, 1)); 6 3 4 5 6 3 4 5 ANSWER DOWNLOAD EXAMIANS APP
PHP Arrays Which array function checks if the specified key exists in the array? array_key_exist() array_keys_exists() array_key_exists() arrays_key_exists() array_key_exist() array_keys_exists() array_key_exists() arrays_key_exists() ANSWER DOWNLOAD EXAMIANS APP
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; $brother Sam is the brother of Bob and Bob) Error Sam is the brother of Bob and Bob) $brother $brother Sam is the brother of Bob and Bob) Error Sam is the brother of Bob and Bob) $brother ANSWER DOWNLOAD EXAMIANS APP