Arrays
Arrays in PHP are sophisticated and more flexible than in many other high-level languages. An array is an ordered set of variables, in which each variable is called an element. Technically, arrays can be either numbered or associative, which means that the elements of an array can be accessed by a numeric index or by a textual string, respectively.
In PHP, an array can hold scalar values-integers, Booleans, strings, or floats-or compound values-objects and even other arrays, and can hold values of different types. In this section, we show how arrays are constructed and introduce several useful array functions from the PHP library.