array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'array.constants.php', 1 => 'Predefined Constants', ), 'up' => array ( 0 => 'book.array.php', 1 => 'Arrays', ), 'prev' => array ( 0 => 'array.resources.php', 1 => 'Resource Types', ), 'next' => array ( 0 => 'array.sorting.php', 1 => 'Sorting Arrays', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/array/constants.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
The constants below are always available as part of the PHP core.
CASE_LOWER
(int)
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(). As of PHP 8.2.0, only ASCII
characters will be converted.
CASE_UPPER
(int)
CASE_UPPER
is used with
array_change_key_case() and is used to convert array
keys to upper case. As of PHP 8.2.0, only ASCII characters will be
converted.
Sorting order flags:
SORT_ASC
(int)
SORT_ASC
is used with
array_multisort() to sort in ascending order.
SORT_DESC
(int)
SORT_DESC
is used with
array_multisort() to sort in descending order.
Sorting type flags: used by various sort functions
SORT_REGULAR
(int)
SORT_REGULAR
is used to compare items normally.
SORT_NUMERIC
(int)
SORT_NUMERIC
is used to compare items numerically.
SORT_STRING
(int)
SORT_STRING
is used to compare items as strings.
SORT_LOCALE_STRING
(int)
SORT_LOCALE_STRING
is used to compare items as
strings, based on the current locale.
SORT_NATURAL
(int)
SORT_NATURAL
is used to compare items as
strings using "natural ordering" like natsort().
SORT_FLAG_CASE
(int)
SORT_FLAG_CASE
can be combined (bitwise OR) with
SORT_STRING
or SORT_NATURAL
to
sort strings case-insensitively. As of PHP 8.2.0, only ASCII case folding
will be done.
Filter flags:
ARRAY_FILTER_USE_KEY
(int)
ARRAY_FILTER_USE_KEY
is used with
array_filter() to pass each key as the first argument to the given callback function.
ARRAY_FILTER_USE_BOTH
(int)
ARRAY_FILTER_USE_BOTH
is used with
array_filter() to pass both value and key to the given callback function.