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;

Sam is the brother of Bob and Bob)
$brother
Sam is the brother of Bob and Bob) $brother
Error

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

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] => NYC [1] => London )
Array ( [0] => Mumbai [1] => Beijing )
Array ( [1] => NYC [0] => London )
Array ( [1] => Mumbai [0] => Beijing )

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
There are three different kind of arrays:

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

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What array will you get if you convert an object to an array?

An array with properties of that object as the array's elements
An array with properties of that object as the Key elements
An array with properties of that array as the object's elements
An array with keys of that object as the array's elements

ANSWER DOWNLOAD EXAMIANS APP