PHP theorytheory 0/50 · 0%
Arrays · easy

5. Arrays

Indexed and associative collections.

PHP arrays are ordered maps that can be indexed numerically or by string keys (associative arrays). They can be created with the short [] syntax or the older array() syntax.

Arrays can mix types and be nested, making them flexible for representing lists, dictionaries, and simple objects.

Check your understanding

  1. 1. How do you create an associative array?

  2. 2. Which syntax creates an empty array?