Predefined Constants
The constants below are always available as part of the PHP core.
-
CASE_LOWER(integer) -
CASE_LOWERis 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_UPPERis used with array_change_key_case() and is used to convert array keys to upper case.
Sorting order flags:
-
SORT_ASC(integer) -
SORT_ASCis used with array_multisort() to sort in ascending order. -
SORT_DESC(integer) -
SORT_DESCis used with array_multisort() to sort in descending order.
Sorting type flags: used by various sort functions
-
SORT_REGULAR(integer) -
SORT_REGULARis used to compare items normally. -
SORT_NUMERIC(integer) -
SORT_NUMERICis used to compare items numerically. -
SORT_STRING(integer) -
SORT_STRINGis used to compare items as strings. -
SORT_LOCALE_STRING(integer) -
SORT_LOCALE_STRINGis used to compare items as strings, based on the current locale. Added in PHP 4.4.0 and 5.0.2. -
SORT_NATURAL(integer) -
SORT_NATURALis used to compare items as strings using "natural ordering" like natsort(). Added in PHP 5.4.0. -
SORT_FLAG_CASE(integer) -
SORT_FLAG_CASEcan be combined (bitwise OR) withSORT_STRINGorSORT_NATURALto sort strings case-insensitively. Added in PHP 5.4.0.
There are no user contributed notes for this page.
