Managing Arrays

PHP arrays have a number of predefined functions that enable you to manage arrays. These include ways to test, count, traverse, and add or remove elements from an array. This section will demonstrate some of these techniques by examining the following:

  • Identification functions, such as count() and is_array()

  • Seeding and padding arrays with range() and array_pad() functions

  • Queue management functions, such as array_push(), array_pop(), array_shift(), and array_unshift()

  • Search functions, such as array_key_exists(), array_keys(), array_search(), array_values(), and in_array()

  • Traversing functions, such as current(), each(), end(), key(), next(), prev(), and reset()

Identification Functions: count() and is_array()

You have already ...

Get Oracle Database 10g Express Edition PHP Web Programming 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.