Array Specifics

An array in PHP is a list of key/value elements in which any number of values can be stored (memory permitting). Each key in an array must be unique within that array. Keys can be either integers or strings, although as this book was being written support for keys of type float had been added and should be available in PHP 4.0.6 (in earlier versions, floating-point key behavior is undefined). An array having only integer keys is typically referred to as an indexed array; an array having string keys is typically called an associative array or a hash. No matter what kind of keys are used, PHP arrays are always hashes internally and will behave as such. This means that it’s perfectly possible to have an indexed array with key values ...

Get PHP Functions Essential Reference 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.