ChapterÂ 4.Â Arrays
AS MENTIONED BRIEFLY IN CHAPTER 1, âThe Basics of PHP,â arrays are containers in which an arbitrary number of other data elements can be stored. If youâre coming to PHP from a language such as C, the concept of array that the former adopts will be a bit different from what youâre used to.
Think of an array as a âcollectionâ of heterogeneous values, each uniquely identified by an arbitrary key, which can itself be either an integer numeric or string value. Thus, for example, an array could contain a floating-point value, a string, a Boolean, and even another array.
Although PHP will automatically provide a key for each value of the array if you insert them sequentially, there doesnât necessarily have to be any correlation ...