Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
$array = array("apple", "banana", "orange");
$array = ["apple", "banana", "orange"];
Both A and B
None of the above
What is the output of the following PHP code snippet?
<?php$array = ["apple", "banana", "orange"];$reversed_array = array_reverse($array);print_r($reversed_array);?>
["orange", "banana", "apple"]
["apple", "banana", "orange"]
["orange", "apple", "banana"]
A collection of similar data types
A collection of different data types
A variable that can hold only one value at a time
$array[0]
$array[1]
$array[first]
$array["first"]
<?php$array = ["apple", "banana", "orange"];$last_element = end($array);echo $last_element;?>
apple
banana
orange
0
<?php$array1 = ["apple", "banana"];$array2 = ["orange", "grape"];$result = array_merge($array1, $array2);print_r($result);?>
["apple", "banana"]
["orange", "grape"]
[0=>"apple", 1=>"banana", 2=>"orange", 3=>"grape"]
<?php$array = ["apple", "banana", "orange"];echo count($array);?>
1
2
3
foreach()
for()
while()
do-while()
unset()
array_splice()
array_remove()
array_shift()
array_push()
array_add()
add_array()
array_append()