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
3 and 4
2, 3 and 4
Only 1

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
There are three different kind of arrays:

Const array, Associative array, Multidimensional array
Numeric array, Associative array, Multidimensional array
Numeric array, String array, Multidimensional array
Numeric array, Associative array, Dimensional array

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What will be the output of the following PHP code ?
$city_west = array("NYC", "London");
$city_east = array("Mumbai", "Beijing");
print_r(array_replace($city_west, $city_east));

Array ( [0] => Mumbai [1] => Beijing )
Array ( [1] => Mumbai [0] => Beijing )
Array ( [1] => NYC [0] => London )
Array ( [0] => NYC [1] => London )

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What will be the output of the following PHP code?
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
print_r(array_change_key_case($age, CASE_UPPER));

Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
Array ( [PeTeR] => 35 [BeN] => 37 [Joe] => 43 )
Array ( [peter] => 35 [ben] => 37 [joe] => 43 )
Array ( [PETER] => 35 [BEN] => 37 [JOE] => 43 )

ANSWER DOWNLOAD EXAMIANS APP