PHP 手冊
上一頁 |  | 下一頁

# II.Array Functions

# 介紹

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. See also Array operators for other ways how to manipulate the arrays.

# 需求

建立這個延伸不需要任何外部程式庫。

# 安裝

這些函數是PHP核心的一部分，不需要安裝就可使用。

# 執行時期組態

`php.ini`中沒有定義此延伸的組態指令。

# 資源類型

這個延伸沒有定義任何資源。

# 預先定義常數

以下經常有效常數為PHP核心的一部分。

`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.

`COUNT_NORMAL` (integer)

`COUNT_RECURSIVE` (integer)

`EXTR_OVERWRITE` (integer)

`EXTR_SKIP` (integer)

`EXTR_PREFIX_SAME` (integer)

`EXTR_PREFIX_ALL` (integer)

`EXTR_PREFIX_INVALID` (integer)

`EXTR_PREFIX_IF_EXISTS` (integer)

`EXTR_IF_EXISTS` (integer)

`EXTR_REFS` (integer)

# 參考

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

上一頁 | 最開頭 | 下一頁
virtual | 上一層 | array_change_key_case