Question 1:
Array values are keyed by ______ values (called indexed arrays) or using ______ values (called associative arrays). Of course, these key methods can be combined as well.
A.
Float, string
B.
Positive number, negative number
C.
Even number, string
D.
String, Boolean
Answer: _________
Question 2:
Which array function checks if the specified key exists in the array?
A.
array_key_exist()
B.
array_key_exists()
C.
array_keys_exists()
D.
arrays_key_exists()
Answer: _________
Question 3:
There are three different kind of arrays:
A.
Numeric array, String array, Multidimensional array
B.
Numeric array, Associative array, Dimensional array
C.
Numeric array, Associative array, Multidimensional array
D.
Const array, Associative array, Multidimensional array
Answer: _________
Question 4:
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?
A.
Yes, because the interpreter must always create a copy of the array before passing it to the function.
B.
Yes, but only if the function modifies the contents of the array.
C.
Yes, but only if the array is large.
D.
Yes, because PHP must monitor the execution of the function to determine if changes are made to the array.
Answer: _________
Question 5:
Assume you would like to sort an array in ascending order by value while preserving key associations. Which of the following PHP sorting functions would you use?
A.
ksort()
B.
asort()
C.
krsort()
D.
sort()
Answer: _________
Question 6:
What function computes the difference of arrays?
A.
array_diff
B.
diff_array
C.
arrays_diff
D.
diff_arrays
Answer: _________
Question 7:
What functions count elements in an array? 1. count 2. Sizeof 3. Array_Count 4. Count_array
A.
Option 2 and 4
B.
Option 1 and 2
C.
Option 3 and 4
D.
Option 1 and 4
Answer: _________
Question 8:
What array will you get if you convert an object to an array?
A.
An array with properties of that object as the array's elements
B.
An array with properties of that array as the object's elements
C.
An array with properties of that object as the Key elements
D.
An array with keys of that object as the array's elements
Answer: _________
Question 9:
PHP’s numerically indexed array begin with position ______.
A.
1
B.
2
C.
0
D.
-1
Answer: _________
Question 10:
Which function will return true if a variable is an array or false if it is not?
A.
this_array()
B.
is_array()
C.
do_array()
D.
in_array()
Answer: _________
Question 11:
Which in-built function will add a value to the end of an array?
A.
array_unshift()
B.
into_array()
C.
inend_array()
D.
array_push()
Answer: _________
Question 12:
Which function can be used to move the pointer to the previous array position?
A.
last()
B.
before()
C.
prev()
D.
previous()
Answer: _________
Question 13:
Which function returns an array consisting of associative key/value pairs?
A.
count()
B.
array_count()
C.
array_count_values()
D.
count_values()
Answer: _________
Question 14:
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”)
A.
3 and 4
B.
2 and 3
C.
Only 1
D.
2, 3 and 4
Answer: _________
Question 15:
What will be the output of the following php code? <?php $states = array( "karnataka" => array( "population" => "11,35,000" , "captial" => "Bangalore" ) , "Tamil Nadu" => array( "population" => "17,90,000" , "captial" => "Chennai" ) )
echo $states [ "karnataka" ][ "population" ]
?>
A.
karnataka 11,35,000
B.
11,35,000
C.
population 11,35,000
D.
karnataka population
Answer: _________
Question 16:
What will be the output of the following PHP code? <?php $state = array ( "Karnataka" , "Goa" , "Tamil Nadu" , "Andhra Pradesh" )
echo (array_search ( "Tamil Nadu" , $state ) )
?>
A.
True
B.
1
C.
False
D.
2
Answer: _________
Question 17:
What will be the output of the following PHP code? <?php $fruits = array ( "apple" , "orange" , "banana" )
echo (next( $fruits ))
echo (next( $fruits ))
?>
A.
orangebanana
B.
appleorange
C.
orangeorange
D.
appleapple
Answer: _________
Question 18:
What will be the output of the following PHP code? <?php $fruits = array ( "apple" , "orange" , array ( "pear" , "mango" ) , "banana" )
echo (count( $fruits, 1 ))
?>
A.
3
B.
4
C.
5
D.
6
Answer: _________
Question 19:
What will be the output of the following PHP code ? <?php $a1 = array ( "a" => "red" , "b" => "green" , "c" => "blue" , "d" => "yellow" )
$a2 = array ("e" => "red" , "f" => "green" , "g" => "blue" )
$result = array_intersect ( $a1, $a2 )
print_r ( $result )
?>
A.
Array ( [a] => red [b] => green [c] => blue )
B.
Array ( [a] => red [b] => green [c] => blue [d] => yellow )
C.
Array ( [e] => red [f] => green [g] => blue )
D.
Array ( [a] => red [b] => green [c] => blue [d] => yellow [e] => red [f] => green [g] => blue )
Answer: _________
Question 20:
What will be the output of the following PHP code ? <?php $a = array( 12 , 5 , 2 )
echo( array_product ( $a ))
?>
A.
024
B.
120
C.
010
D.
060
Answer: _________
Question 21:
What will be the output of the following PHP code ? <?php $a = array( "a" => "Jaguar" , "b" => "Land Rover" , "c" => "Audi" , "d" => "Maseratti" )
echo array_search( "Audi" , $a )
?>
A.
a
B.
b
C.
c
D.
d
Answer: _________
Question 22:
What will be the output of the following PHP code ? <?php $city_west = array( "NYC" , "London" )
$city_east = array( "Mumbai" , "Beijing" )
print_r( array_replace ( $city_west, $city_east ))
?>
A.
Array ( [1] => Mumbai [0] => Beijing )
B.
Array ( [0] => NYC [1] => London )
C.
Array ( [1] => NYC [0] => London )
D.
Array ( [0] => Mumbai [1] => Beijing )
Answer: _________
Question 23:
What will be the output of the following PHP code ? <?php $people = array( "Peter" , "Susan" , "Edmund" , "Lucy" )
echo pos( $people )
?>
A.
Lucy
B.
Peter
C.
Susan
D.
Edmund
Answer: _________
Question 24:
What will be the output of the following PHP code ? <?php $number = range( 0 , 5 )
print_r ( $number )
?>
A.
Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 )
B.
Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 )
C.
Array ( [0] => 5 [1] => 5 [2] => 5 [3] => 5 [4] => 5 [5] => 5 )
D.
Array ( [0] => 0 [5] => 5 )
Answer: _________
Question 25:
What will be the output of the following PHP code ? <?php $array = array( "red" , "green" )
array_push( $array, "blue" , "yellow" )
print_r( $array )
?>
A.
Array ( [0] => red [1] => green [2] => blue [3] => yellow )
B.
Array ( [0] => blue [1] => yellow [2] => red [3] => green )
C.
Array ( [0] => red [1] => green )
D.
Array ( [0] => blue [1] => yellow )
Answer: _________
Question 26:
What will be the output of the following PHP code? <?php $age = array( "Peter" => "35" , "Ben" => "37" , "Joe" => "43" )
print_r(array_change_key_case( $age, CASE_UPPER ))
?>
A.
Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
B.
Array ( [peter] => 35 [ben] => 37 [joe] => 43 )
C.
Array ( [PETER] => 35 [BEN] => 37 [JOE] => 43 )
D.
Array ( [PeTeR] => 35 [BeN] => 37 [Joe] => 43 )
Answer: _________
Question 27:
What will be the output of the following PHP code? <?php $cars = array( "Volvo" , "BMW" , "Toyota" , "Honda" , "Mercedes" , "Opel " )
print_r(array_chunk( $cars, 2 ))
?>
A.
Array ( [0] => Array ( [1] => Volvo [2] => BMW ) [1] => Array ( [1] => Toyota [2] => Honda ) [2] => Array ( [1] => Mercedes [2] => Opel ) )
B.
Array ( [1] => Array ( [1] => Volvo [2] => BMW ) [2] => Array ( [1] => Toyota [2] => Honda ) [3] => Array ( [1] => Mercedes [2] => Opel ) )
C.
Array ( [0] => Array ( [0] => Volvo [1] => Volvo ) [1] => Array ( [0] => BMW [1] => BMW ) [2] => Array ( [0] => Toyota [1] => Toyota ) )
D.
Array ( [0] => Array ( [0] => Volvo [1] => BMW ) [1] => Array ( [0] => Toyota [1] => Honda ) [2] => Array ( [0] => Mercedes [1] => Opel ) )
Answer: _________
Question 28:
What will be the output of the following PHP code? <?php $fname = array( "Peter" , "Ben" , "Joe" )
$age = array( "35" , "37" , "43" )
$c = array_combine( $fname, $age )
print_r( $c )
?>
A.
Array ( Peter Ben Joe )
B.
Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
C.
Array ( 35 37 43 )
D.
Array ( “[Peter] => 35” “[Ben] => 37” “[Joe] => 43” )
Answer: _________
Question 29:
What will be the output of the following PHP code? <?php $cars = array( "Volvo" , "BMW" , "Toyota" )
echo "I like " . $cars [ 2 ] . ", " . $cars [ 1 ] . " and " . $cars [ 0 ] . "."
?>
A.
I like Volvo, Toyota and BMW
B.
I like Volvo, BMW and Toyota
C.
I like BMW, Volvo and Toyota
D.
I like Toyota, BMW and Volvo
Answer: _________
Question 30:
What will be the output of the following PHP code? <?php $fname = array( "Peter" , "Ben" , "Joe" )
$age = array( "35" , "37" , "43" )
$c = array_combine( $age, $fname )
print_r( $c )
?>
A.
Array ( Peter Ben Joe )
B.
Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
C.
Array ( 35 37 43 )
D.
Array ( [35] => Peter [37] => Ben [43] => Joe )
Answer: _________
Question 31:
What will be the output of the following PHP code? <?php $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 ))
?>
A.
Array ( [A] => 5 [Cat] => 2 [Dog] => 2 [Tiger] => 1 )
B.
Array ( [A] => 2 [Cat] => 2 [Dog] => 1 [Tiger] => 1 )
C.
Array ( [A] => 6 [Cat] => 1 [Dog] => 2 [Tiger] => 1 )
D.
Array ( [A] => 2 [Cat] => 1 [Dog] => 4 [Tiger] => 1 )
Answer: _________
Question 32:
What will be the output of the following PHP code? <?php $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 )
?>
A.
Array ( [d] => yellow )
B.
Array ( [i] => orange )
C.
Array ( [h] => orange )
D.
Array ( [d] => yellow [h] => orange )
Answer: _________
Question 33:
What will be the output of the following PHP code? <?php $a1 = array( "red" , "green" )
$a2 = array( "blue" , "yellow" )
$a3 = array_merge( $a1, $a2 )
$a4 = array( "a" , "b" , "c" , "d" )
$a = array_combine( $a4, $a3 )
print_r( $a )
?>
A.
Array ( [a] => blue [b] => yellow [c] => red [d] => green )
B.
Array ( [0] => blue [1] => yellow [2] => red [3] => green )
C.
Array ( [0] => red [1] => green [2] => blue [3] => yellow )
D.
Array ( [a] => red [b] => green [c] => blue [d] => yellow )
Answer: _________
Question 34:
What will be the output of the following PHP code? <?php $names = array( "Sam" , "Bob" , "Jack" )
echo $names [ 0 ] . "is the brother of " . $names [ 1 ] . " and " . $names [ 1 ] . "."
?>
A.
Sam is the brother of Bob and Jack
B.
Sam is the brother of Bob and Bob)
C.
Sam is the brother of Jack and Bob)
D.
Error
Answer: _________
Question 35:
What will be the output of the following PHP code? <?php $names = array( "Sam" , "Bob" , "Jack" )
echo $names [ 0 ] . "is the brother of " . $names [ 1 ] . " and " . $names [ 1 ] . "." . $brother
?>
A.
Sam is the brother of Bob and Bob) $brother
B.
Sam is the brother of Bob and Bob)
C.
$brother
D.
Error
Answer: _________
Question 36:
What will be the output of the following PHP code? <?php $place = array( "NYC" , "LA" , "Paris" )
array_pop( $place )
$place1 = array( "Paris" )
$place = array_merge( $place, $place1 )
print_r( $place )
?>
A.
Array ( [0] => LA [1] => Paris [2] => Paris )
B.
Array ( [0] => NYC [1] => LA [2] => Paris)
C.
Array ( [0] => NYC [1] => LA [2] => Paris [3] => Paris )
D.
None of the mentioned
Answer: _________
Question 37:
What will be the output of the following PHP code ? <?php $age = array ( "Harry" => "21" , "Ron" => "23" , "Malfoy" => "21" )
array_change_key_case ( $age, CASE_UPPER )
array_pop ( $age )
print_r ( $age )
?>
A.
Array ( [Harry] => 21 [Ron] => 23 [Malfoy] => 21 )
B.
Array ( [HARRY] => 21 [RON] => 23 [MALFOY] => 21 )
C.
Array ( [HARRY] => 21 [RON] => 23 )
D.
Array ( [Harry] => 21 [Ron] => 23 )
Answer: _________
Question 38:
What will be the output of the following PHP code ? <?php $a1 = array ( "a" => "red" , "b" => "green" , "c" => "blue" , "d" => "yellow" )
$result = array_flip ( $a1 )
print_r ( $result )
?>
A.
Array ( [red] => red [green] => green [blue] => blue [yellow] => yellow )
B.
Array ( [a] => a [b] => b [c] => c [d] => d )
C.
Array ( [red] => a [green] => b [blue] => c [yellow] => d )
D.
Array ( [a] => red [b] => green [c] => blue [d] => yellow )
Answer: _________
Question 39:
What will be the output of the following PHP code? <?php $fruits = array ( "apple" , "mango" , "peach" , "pear" , "orange" )
$subset = array_splice ( $fruits, 2 )
print_r ( $fruits )
?>
A.
Error
B.
Array ( [0] => apple [1] => mango [2] => peach )
C.
Array ( [0] => apple [1] => mango )
D.
Array ( [0] => pear [1] => orange )
Answer: _________
Question 40:
What will be the output of the following PHP code? <?php $number = array ( "4" , "hello" , 2 )
echo (array_sum ( $number ))
?>
A.
4hello2
B.
4
C.
2
D.
6
Answer: _________
Question 41:
What will be the output of the following PHP code? <?php $array1 = array ( "KA" , "LA" , "CA" , "MA" , "TA" )
$array2 = array ( "KA" , "IA" , "CA" , "GA" , "TA" )
$inter = array_intersect ( $array1, $array2 )
print_r ( $inter )
?>
A.
Array ( [0] => KA [1] => LA [2] => CA [3] => MA [4] => TA [5] => IA [6] => GA )
B.
Array ( [0] => KA [2] => CA [4] => TA )
C.
Array ( [1] => IA [3] => GA )
D.
Array ( [1] => LA [3] => MA )
Answer: _________
Question 42:
What will the following script output? <?php $array = array (1, 2, 3, 5, 8, 13, 21, 34, 55)
$sum = 0
for ($i = 0
$i < 5
$i++) { $sum += $array[$array[$i]]
} echo $sum
?>
A.
78
B.
19
C.
NULL
D.
5
Answer: _________
Question 43:
What elements will the following script output? <?php $array = array ( true => 'a', 1 => 'b' )
var_dump ( $array )
?>
A.
1 => 'b'
B.
True => 'a', 1 => 'b'
C.
0 => 'a', 1 => 'b'
D.
None
Answer: _________
Question 44:
What will be the output of the following PHP code? <?php $a = array( "A" , "Cat" , "Dog" , "A" , "Dog" )
print_r(array_count_values( $a ))
?>
A.
Array ( [A] => 2 [Cat] => 1 [Dog] => 2 )
B.
Array ( [A] => 2 [Cat] => 2 [Dog] => 1 )
C.
Array ( [A] => 1 [Cat] => 1 [Dog] => 2 )
D.
Array ( [A] => 2 [Cat] => 1 [Dog] => 1)
Answer: _________
Question 45:
What will be the output of the following PHP code? <?php $a1 = array( "a" => "red" , "b" => "green" , "c" => "blue" , "d" => "yellow" )
$a2 = array( "e" => "red" , "f" => "green" , "g" => "blue" )
$result = array_diff( $a1, $a2 )
print_r( $result )
?>
A.
Array ( [d] => yellow )
B.
Array ( [c] => blue )
C.
Array ( [a] => red )
D.
Array ( [e] => yellow )
Answer: _________
Question 46:
What will be the output of the following PHP code? <?php $a1 = array( "red" , "green" )
$a2 = array( "blue" , "yellow" )
print_r(array_merge( $a1, $a2 ))
?>
A.
Array ( [0] => red [1] => green)
B.
Array ( [0] => blue [1] => yellow [2] => red [3] => green )
C.
Array ( [0] => red [1] => green [2] => blue [3] => yellow )
D.
Array ( [0] => blue [1] => yellow )
Answer: _________
Question 47:
What will be the output of the following PHP code? <?php $a = array( "a" => "red" , "b" => "green" , "c" => "blue" )
echo array_shift( $a )
print_r ( $a )
?>
A.
green
B.
red
C.
blue
D.
none of the mentioned
Answer: _________
Question 48:
What will be the output of the following PHP code? <?php $a = array( "red" , "green" , "blue" )
array_pop( $a )
print_r( $a )
?>
A.
Array ( [0] => red [1] => green )
B.
Array ( [0] => green [1] => blue )
C.
Array ( [0] => red [1] => blue )
D.
Array ( [0] => blue [1] => blue )
Answer: _________
Question 49:
What will be the output of the following PHP code? <?php $fruits = array ( "mango" , "apple" , "pear" , "peach" )
$fruits = array_flip( $fruits )
echo ( $fruits [ 0 ])
?>
A.
mango
B.
error
C.
peach
D.
0
Answer: _________
Question 50:
What will be the output of the following PHP code? <?php $fruits = array ( "mango" , "apple" , "peach" , "pear" )
$fruits = asort ( $fruits )
printr ( $fruits )
?>
A.
Array ( [1] => apple [0] => mango [2] => peach [3] => pear )
B.
Array ( [0] => apple [1] => mango [2] => peach [3] => pear )
C.
Error
D.
Array ( [1] => apple [0] => mango [3] => peach [2] => pear )
Answer: _________
Question 51:
What will be the output of the following PHP code? <?php $arr = array ( "picture1.JPG" , "picture2.jpg" , "Picture10.jpg" , "picture20.jpg" )
sort( $arr )
print_r( $arr )
?>
A.
Array ( [0] => picture1.JPG [1] => Picture10.jpg [2] => picture2.jpg [3] => picture20.jpg )
B.
Array ( [0] => picture1.JPG [1] => picture2.jpg [2] => Picture10.jpg [3] => picture20.jpg )
C.
Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture2.jpg [3] => picture20.jpg )
D.
Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture20.jpg [3] => picture2.jpg )
Answer: _________
Question 52:
What will be the output of the following PHP code? <?php $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 )
?>
A.
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 )
B.
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 )
C.
Error
D.
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 )
Answer: _________
Question 53:
What will be the output of the following PHP code? <?php $fruits = array ( "apple" , "mango" , "peach" , "pear" , "orange" )
$subset = array_slice ( $fruits, 2 )
print_r ( $subset )
?>
A.
Array ( [0] => peach )
B.
Array ( [0] => apple [1] => mango [2] => peach )
C.
Array ( [0] => apple [1] => mango )
D.
Array ( [0] => peach [1] => pear [2] => orange )
Answer: _________
Answer Key
1:
N/A
2:
B
3:
C
4:
N/A
5:
B
6:
A
7:
B
8:
A
9:
C
Solution: Like many programming languages, the first element of an array has an index value of 0.
10:
B
Solution: A built-in function, is_array(), is available for testing an array. Its prototype follows: boolean is_array(mixed variable).
11:
D
Solution: array_push adds a value to the end of an array, returning the total count of elementsin the array after the new value has been added.
12:
C
13:
C
14:
A
Solution: A variable name should start with $ symbol which is not present in i) and you need not put the square brackets when you use the array() constructor.
15:
B
Solution: Treat states as a multidimensional array and accordingly traverse it to get the value.
16:
D
Solution: The array_search() function searches an array for a specified value, returning its key if located and FALSE otherwise.
17:
A
Solution: The next() function returns the array value residing at the position immediately following that of the current array pointer.
18:
D
Solution: The array entity holding pear and mango is counted as an item, just as its contents are.
19:
A
Solution: The array_intersect() function compares the values of two (or more) arrays, and returns the matches.
20:
B
Solution: The array_product() function calculates and returns the product of an array.
21:
C
Solution: The array_search() function searches for the element and returns the key of that element.
22:
D
Solution: The array_replace() function replaces the values of the first array with the values from following arrays
23:
B
Solution: The pos() function returns the value of the current element in an array, and since no operation has been done, the current element is the first element.
24:
A
Solution: The range() function creates an array containing a range of elements.
25:
A
Solution: The array_push() function inserts one or more elements to the end of an array.
26:
C
Solution: The array_change_key_case() function changes all keys in an array to lowercase or uppercase.
27:
D
Solution: The array_chunk() function splits an array into chunks of new arrays.
28:
B
Solution: The array_combine() function creates an array by using the elements from one “keys” array and one “values” array.
29:
D
Solution: The order of elements defined.
30:
D
Solution: Here “keys” array is $age and “values” array is $fname.
31:
A
Solution: The array_count_values() function counts all the values of an array and array_combine() combines arrays.
32:
A
Solution: The array_diff() function compares the values of two (or more) arrays, and returns the differences.
33:
D
Solution: Basic combined application of array_combine() and array_merge().
34:
B
Solution: Simple definition of array and using it in a string. We have used $names[1] twice and hence Bob appears twice.
35:
D
Solution: $brother undeclared.
36:
A
Solution: array_merge() and array_pop() yields that result.
37:
C
Solution: The array_change_key_case() function changes all keys in an array to lowercase or uppercase and arry_pop() removes last element
38:
C
Solution: The array_flip() function flips/exchanges all keys with their associated values in an array.
39:
C
Solution: The array_splice() function removes all elements of an array found within a specified range.
40:
D
Solution: The array_sum() function add all the values of the input array together, returning the final sum. If a string datatype is found, it’ll be ignored.
41:
B
Solution: The array_intersect() function returns a key preserved array consisting only of those values present in the first array that are also present in each of the other input arrays.
42:
A
43:
N/A
44:
A
Solution: The array_count_values() function counts all the values of an array.
45:
A
Solution: The array_diff() function compares the values of two (or more) arrays, and returns the differences.
46:
C
Solution: The array_merge() function merges one or more arrays into one array.
47:
B
Solution: The array_shift() function removes the first element from an array, and returns the value of the removed element.
48:
A
Solution: The array_pop() function deletes the last element of an array.
49:
B
Solution: As we are flipping the values, $fruits[“mango”] = 0, $fruits[“apple”] = 1 and so on.
50:
A
Solution: The function asort() sorts the array in ascending order, except that the key/value corresponding is maintained.
51:
C
Solution: While sorting each character is compared with the others and sorted using ascii values therefore we the sorted array to be like option c.
52:
A
Solution: The resulting array will begin with the first input array parameter, appending each subsequent array parameter in the order of appearance.
53:
D
Solution: The array_slice() function returns a section of an array based on a starting and ending offset value.