1.
What type of index do indexed arrays in PHP use?
2.
Which of the following statements is true about associative arrays in PHP?
3.
What is the output of the following PHP code?
<?php
$colors = array("Red", "Green", "Blue");
echo $colors[1];
?
4.
Which PHP construct is commonly used to iterate over elements of an array?
5.
What will be the output of the following PHP code?
<?php
$person = array("name" => "John", "age" => 30, "city" => "New York");
echo $person["age"];
?
6.
What is the correct syntax for creating a multidimensional array in PHP?
7.
What will be the output of the following PHP code?
<?php
$matrix = array(
array(1, 2, 3),
array(4, 5, 6),
array(7, 8, 9)
);
echo $matrix[1][2];
?
8.
Which PHP function is used to determine the number of elements in an array?
9.
What will be the output of the following PHP code?
<?php
$numbers = array(10, 20, 30, 40, 50);
echo count($numbers);
?
10.
What is the purpose of the array_push() function in PHP?