Predefined Constants
The constants below are always available as part of the PHP core.
-
CASE_LOWER(int) -
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(int) -
CASE_UPPERis used with array_change_key_case() and is used to convert array keys to upper case.
Sorting order flags:
-
SORT_ASC(int) -
SORT_ASCis used with array_multisort() to sort in ascending order. -
SORT_DESC(int) -
SORT_DESCis used with array_multisort() to sort in descending order.
Sorting type flags: used by various sort functions
-
SORT_REGULAR(int) -
SORT_REGULARis used to compare items normally. -
SORT_NUMERIC(int) -
SORT_NUMERICis used to compare items numerically. -
SORT_STRING(int) -
SORT_STRINGis used to compare items as strings. -
SORT_LOCALE_STRING(int) -
SORT_LOCALE_STRINGis used to compare items as strings, based on the current locale. -
SORT_NATURAL(int) -
SORT_NATURALis used to compare items as strings using "natural ordering" like natsort(). -
SORT_FLAG_CASE(int) -
SORT_FLAG_CASEcan be combined (bitwise OR) withSORT_STRINGorSORT_NATURALto sort strings case-insensitively.
Filter flags:
-
ARRAY_FILTER_USE_KEY(int) -
ARRAY_FILTER_USE_KEYis 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_BOTHis used with array_filter() to pass both value and key to the given callback function.
-
COUNT_NORMAL(int) -
COUNT_RECURSIVE(int) -
EXTR_OVERWRITE(int) -
EXTR_SKIP(int) -
EXTR_PREFIX_SAME(int) -
EXTR_PREFIX_ALL(int) -
EXTR_PREFIX_INVALID(int) -
EXTR_PREFIX_IF_EXISTS(int) -
EXTR_IF_EXISTS(int) -
EXTR_REFS(int)

