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", "h" => "orange");
$a3 = array("i" => "orange");
$a4 = array_combine($a2, $a3);
$result = array_diff($a4, $a2);
print_r($result);

Array ( [d] => yellow )
Array ( [d] => yellow [h] => orange )
Array ( [i] => orange )
Array ( [h] => orange )

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What will be the output of the following PHP code?
$arr = array ("picture1.JPG", "picture2.jpg", "Picture10.jpg", "picture20.jpg");
sort($arr);
print_r($arr);

Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture20.jpg [3] => picture2.jpg )
Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture2.jpg [3] => picture20.jpg )
Array ( [0] => picture1.JPG [1] => Picture10.jpg [2] => picture2.jpg [3] => picture20.jpg )
Array ( [0] => picture1.JPG [1] => picture2.jpg [2] => Picture10.jpg [3] => picture20.jpg )

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] => 5 [Cat] => 2 [Dog] => 2 [Tiger] => 1 )
Array ( [A] => 2 [Cat] => 2 [Dog] => 1 [Tiger] => 1 )
Array ( [A] => 6 [Cat] => 1 [Dog] => 2 [Tiger] => 1 )
Array ( [A] => 2 [Cat] => 1 [Dog] => 4 [Tiger] => 1 )

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