PHP Manual
Prev |  | Next

# II. Array Functions

# Introduction

These functions allow you to interact with and manipulate arrays in various ways. Arrays are essential for storing, managing, and operating on sets of variables.

Simple and multi-dimensional arrays are supported, and may be either user created or created by another function. There are specific database handling functions for populating arrays from database queries, and several functions return arrays.

Please see the Arrays section of the manual for a detailed explanation of how arrays are implemented and used in PHP.

# Requirements

No external libraries are needed to build this extension.

# Installation

There is no installation needed to use these functions; they are part of the PHP core.

# Runtime Configuration

This extension has no configuration directives defined in `php.ini`.

# Resource Types

This extension has no resource types defined.

# Predefined Constants

The constants below are always available as part of the PHP core.

`CASE_LOWER` (integer)

  `CASE_LOWER` is used with array_change_key_case() and is used to convert array keys to lower case. This is also the default case for array_change_key_case().

`CASE_UPPER` (integer)

  `CASE_UPPER` is used with array_change_key_case() and is used to convert array keys to upper case.

Sorting order flags:

`SORT_ASC` (integer)

  `SORT_ASC` is used with array_multisort() to sort in ascending order.

`SORT_DESC` (integer)

  `SORT_DESC` is used with array_multisort() to sort in descending order.

Sorting type flags: used by various sort functions

`SORT_REGULAR` (integer)

  `SORT_REGULAR` is used to compare items normally.

`SORT_NUMERIC` (integer)

  `SORT_NUMERIC` is used to compare items numerically.

`SORT_STRING` (integer)

  `SORT_STRING` is used to compare items as strings.

# See Also

See also is_array(), explode(), implode(), split(), preg_split(), and join().

Prev | Home | Next
virtual | Up | array_change_key_case