Arrays - indexed and associative arrays, looping arrays, array operations - Online Test
30:00
1. What is the primary purpose of arrays in PHP?
2. In PHP, how are indexed arrays typically created?
3. Which of the following is an example of an indexed array declaration in PHP?
4. What is the default starting index for an indexed array in PHP?
5. How can you access an element in an indexed array in PHP?
6. What distinguishes an associative array from an indexed array in PHP?
7. Which syntax is used to declare an associative array in PHP?
8. If you have an associative array like $config = ['host' => 'localhost', 'user' => 'root']; how do you access the username?
9. What is the result of printing an array directly using `print_r($myArray);`?
10. Which PHP construct is commonly used to loop through all elements of an array, regardless of whether it's indexed or associative?
Test Results
0/0