PHP Arrays
What will be the output of the following PHP code?
$a = array("A", "Cat", "Dog", "A", "Dog");
print_r(array_count_values($a));

Array ( [A] => 1 [Cat] => 1 [Dog] => 2 )
Array ( [A] => 2 [Cat] => 2 [Dog] => 1 )
Array ( [A] => 2 [Cat] => 1 [Dog] => 1)
Array ( [A] => 2 [Cat] => 1 [Dog] => 2 )

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What will be the output of the following PHP code?
$fruits = array ("mango", "apple", "peach", "pear");
$fruits = asort ($fruits);
printr ($fruits);

Array ( [1] => apple [0] => mango [2] => peach [3] => pear )
Array ( [0] => apple [1] => mango [2] => peach [3] => pear )
Array ( [1] => apple [0] => mango [3] => peach [2] => pear )
Error

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What will be the output of the following PHP code ?
$array = array("red", "green");
array_push($array, "blue", "yellow");
print_r($array);

Array ( [0] => blue [1] => yellow )
Array ( [0] => blue [1] => yellow [2] => red [3] => green )
Array ( [0] => red [1] => green )
Array ( [0] => red [1] => green [2] => blue [3] => yellow )

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($fname, $age);
print_r($c);

Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
Array ( 35 37 43 )
Array ( Peter Ben Joe )
Array ( “[Peter] => 35” “[Ben] => 37” “[Joe] => 43” )

ANSWER DOWNLOAD EXAMIANS APP