Test Your Knowledge

  1. What is the difference between a numeric and an associative array?

  2. What is the main benefit of the array keyword?

  3. What is the difference between foreach and each?

  4. How can you create a multidimensional array?

  5. How can you determine the number of elements in an array?

  6. What is the purpose of the explode function?

  7. How can you set PHP’s internal pointer into an array back to the first element of the array?

See Chapter 6 Answers in Appendix A for the answers to these questions.

Get Learning PHP, MySQL, JavaScript, and CSS, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.