O'Reilly logo

Zend PHP 5 Certification Study Guide by Ben Ramsey, Davey Shafik

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Arrays

Arrays are the undisputed kings of advanced data structures in PHP. PHP arrays are extremely flexible—they allow numeric auto-incremented keys, alphanumeric keys, or a mix of both, and are capable of storing practically any value, including other arrays. With over seventy functions for manipulating them, arrays can do almost anything you can imagine—and then some.

Array Basics

All arrays are ordered collections of items, called elements. Each element has a value, and is identified by a key that is unique to the array it belongs to. As we mentioned in the previous paragraph, keys can be either integer numbers or strings of arbitrary length.

Arrays are created in multiple ways. The first, and most common, is by explicitly calling the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required