PHP Arrays
What will be the output of the following PHP code?
$face = array ("A", "J", "Q", "K");
$number = array ("2","3","4", "5", "6", "7", "8", "9", "10");
$cards = array_merge ($face, $number);
print_r ($cards);

Array ( [0] => A [1] => J [2] => Q [3] => K [4] => 2 [5] => 3 [6] => 4 [7] => 5 [8] => 6 [9] => 7 [10] => 8 [11] => 9 [12] => 10 )
Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 5 [4] => 6 [5] => 7 [6] => 8 [7] => 9 [8] => 10 [9] => A [10] => J [11] => Q [12] => K )
Array ( [0] => A [1] => 2 [2] => J [3] => 3 [4] => Q [5] => 4 [6] => K [7] => 5 [8] => 6 [9] => 7 [10] => 8 [11] => 9 [12] => 10 )
Error

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");
$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 [h] => orange )
Array ( [i] => orange )
Array ( [h] => orange )
Array ( [d] => yellow )

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
Absent any actual need for choosing one method over the other, does passing arrays by value to a read-only function reduce performance compared to passing them by reference?

Yes, but only if the array is large.
Yes, but only if the function modifies the contents of the array.
Yes, because the interpreter must always create a copy of the array before passing it to the function.
Yes, because PHP must monitor the execution of the function to determine if changes are made to the array.
No

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What will be the output of the following PHP code?
$cars = array("Volvo", "BMW", "Toyota", "Honda", "Mercedes", "Opel");
print_r(array_chunk($cars, 2));

Array ( [0] => Array ( [1] => Volvo [2] => BMW ) [1] => Array ( [1] => Toyota [2] => Honda ) [2] => Array ( [1] => Mercedes [2] => Opel ) )
Array ( [0] => Array ( [0] => Volvo [1] => BMW ) [1] => Array ( [0] => Toyota [1] => Honda ) [2] => Array ( [0] => Mercedes [1] => Opel ) )
Array ( [0] => Array ( [0] => Volvo [1] => Volvo ) [1] => Array ( [0] => BMW [1] => BMW ) [2] => Array ( [0] => Toyota [1] => Toyota ) )
Array ( [1] => Array ( [1] => Volvo [2] => BMW ) [2] => Array ( [1] => Toyota [2] => Honda ) [3] => Array ( [1] => Mercedes [2] => Opel ) )

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

ANSWER DOWNLOAD EXAMIANS APP