8 Arrays
An array is a very important data type for any programming language. An array stores several data values, which you can then access again.
In PHP, arrays are particularly flexible as they can hold any data type, and even different data types. The reason for this is that PHP does not use strict typing unless explicitly enabled.
Note
Other programming languages restrict arrays to one data type (including vector arrays). There are structures for this, for example. Arrays in PHP are similar to hashes in Perl, but with small differences in the syntax.
Arrays are also very common in PHP itself. For example, the $_POST and $_GET superglobal variables, which hold the values of form elements, are also arrays. Database returns are also frequently ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access