<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.array.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'array.constants.php',
    1 => 'Predefined Constants',
    2 => 'Predefined Constants',
  ),
  'up' => 
  array (
    0 => 'book.array.php',
    1 => 'Arrays',
  ),
  'prev' => 
  array (
    0 => 'book.array.php',
    1 => 'Arrays',
  ),
  'next' => 
  array (
    0 => 'array.sorting.php',
    1 => 'Sorting Arrays',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/array/constants.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="array.constants" class="appendix">
 <h1 class="title">Predefined Constants</h1>

 <p class="simpara">
The constants below are always available as part of the PHP core.
</p>
 <p class="para">
 <dl>
  
   <dt id="constant.case-lower">
    <strong><code><a href="array.constants.php#constant.case-lower">CASE_LOWER</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <strong><code><a href="array.constants.php#constant.case-lower">CASE_LOWER</a></code></strong> is used with
     <span class="function"><a href="function.array-change-key-case.php" class="function">array_change_key_case()</a></span> and is used to convert array
     keys to lower case. This is also the default case for
     <span class="function"><a href="function.array-change-key-case.php" class="function">array_change_key_case()</a></span>. As of PHP 8.2.0, only ASCII
     characters will be converted.
    </span>
   </dd>
  
  
   <dt id="constant.case-upper">
    <strong><code><a href="array.constants.php#constant.case-upper">CASE_UPPER</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <strong><code><a href="array.constants.php#constant.case-upper">CASE_UPPER</a></code></strong> is used with
     <span class="function"><a href="function.array-change-key-case.php" class="function">array_change_key_case()</a></span> and is used to convert array
     keys to upper case. As of PHP 8.2.0, only ASCII characters will be
     converted.
    </span>
   </dd>
  
 </dl>
 </p>

 <p class="para">Sorting order flags:
 <dl>
  
   <dt id="constant.sort-asc">
    <strong><code><a href="array.constants.php#constant.sort-asc">SORT_ASC</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <strong><code><a href="array.constants.php#constant.sort-asc">SORT_ASC</a></code></strong> is used with
     <span class="function"><a href="function.array-multisort.php" class="function">array_multisort()</a></span> to sort in ascending order.
    </span>
   </dd>
  
  
   <dt id="constant.sort-desc">
    <strong><code><a href="array.constants.php#constant.sort-desc">SORT_DESC</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <strong><code><a href="array.constants.php#constant.sort-desc">SORT_DESC</a></code></strong> is used with
     <span class="function"><a href="function.array-multisort.php" class="function">array_multisort()</a></span> to sort in descending order.
    </span>
   </dd>
  
 </dl>
 </p>

 <p class="para"> Sorting type flags: used by various sort functions
 <dl>
  
   <dt id="constant.sort-regular">
    <strong><code><a href="array.constants.php#constant.sort-regular">SORT_REGULAR</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <strong><code><a href="array.constants.php#constant.sort-regular">SORT_REGULAR</a></code></strong> is used to compare items normally.
    </span>
   </dd>
  
  
   <dt id="constant.sort-numeric">
    <strong><code><a href="array.constants.php#constant.sort-numeric">SORT_NUMERIC</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <strong><code><a href="array.constants.php#constant.sort-numeric">SORT_NUMERIC</a></code></strong> is used to compare items numerically.
    </span>
   </dd>
  
  
   <dt id="constant.sort-string">
    <strong><code><a href="array.constants.php#constant.sort-string">SORT_STRING</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
    <strong><code><a href="array.constants.php#constant.sort-string">SORT_STRING</a></code></strong> is used to compare items as strings.
    </span>
   </dd>
  
  
   <dt id="constant.sort-locale-string">
    <strong><code><a href="array.constants.php#constant.sort-locale-string">SORT_LOCALE_STRING</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
    <strong><code><a href="array.constants.php#constant.sort-locale-string">SORT_LOCALE_STRING</a></code></strong> is used to compare items as
    strings, based on the current locale.
    </span>
   </dd>
  
  
   <dt id="constant.sort-natural">
    <strong><code><a href="array.constants.php#constant.sort-natural">SORT_NATURAL</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
    <strong><code><a href="array.constants.php#constant.sort-natural">SORT_NATURAL</a></code></strong> is used to compare items as
    strings using &quot;natural ordering&quot; like <span class="function"><a href="function.natsort.php" class="function">natsort()</a></span>.
    </span>
   </dd>
  
  
   <dt id="constant.sort-flag-case">
    <strong><code><a href="array.constants.php#constant.sort-flag-case">SORT_FLAG_CASE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <strong><code><a href="array.constants.php#constant.sort-flag-case">SORT_FLAG_CASE</a></code></strong> can be combined (bitwise OR) with
     <strong><code><a href="array.constants.php#constant.sort-string">SORT_STRING</a></code></strong> or <strong><code><a href="array.constants.php#constant.sort-natural">SORT_NATURAL</a></code></strong> to
     sort strings case-insensitively. As of PHP 8.2.0, only ASCII case folding
     will be done.
    </span>
   </dd>
  
 </dl>
 </p>

 <p class="para"> Filter flags:
 <dl>
  
   <dt id="constant.array-filter-use-key">
    <strong><code><a href="array.constants.php#constant.array-filter-use-key">ARRAY_FILTER_USE_KEY</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <strong><code><a href="array.constants.php#constant.array-filter-use-key">ARRAY_FILTER_USE_KEY</a></code></strong> is used with
     <span class="function"><a href="function.array-filter.php" class="function">array_filter()</a></span> to pass each key as the first argument to the given callback function.
    </span>
   </dd>
  
  
   <dt id="constant.array-filter-use-both">
    <strong><code><a href="array.constants.php#constant.array-filter-use-both">ARRAY_FILTER_USE_BOTH</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <strong><code><a href="array.constants.php#constant.array-filter-use-both">ARRAY_FILTER_USE_BOTH</a></code></strong> is used with
     <span class="function"><a href="function.array-filter.php" class="function">array_filter()</a></span> to pass both value and key to the given callback function.
    </span>
   </dd>
  
 </dl>
 </p>

 <dl>
  
   <dt id="constant.count-normal">
    <strong><code><a href="array.constants.php#constant.count-normal">COUNT_NORMAL</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">

    </span>
   </dd>
  
  
   <dt id="constant.count-recursive">
    <strong><code><a href="array.constants.php#constant.count-recursive">COUNT_RECURSIVE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">

    </span>
   </dd>
  
  
   <dt id="constant.extr-overwrite">
    <strong><code><a href="array.constants.php#constant.extr-overwrite">EXTR_OVERWRITE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">

    </span>
   </dd>
  
  
   <dt id="constant.extr-skip">
    <strong><code><a href="array.constants.php#constant.extr-skip">EXTR_SKIP</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">

    </span>
   </dd>
  
  
   <dt id="constant.extr-prefix-same">
    <strong><code><a href="array.constants.php#constant.extr-prefix-same">EXTR_PREFIX_SAME</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">

    </span>
   </dd>
  
  
   <dt id="constant.extr-prefix-all">
    <strong><code><a href="array.constants.php#constant.extr-prefix-all">EXTR_PREFIX_ALL</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">

    </span>
   </dd>
  
  
   <dt id="constant.extr-prefix-invalid">
    <strong><code><a href="array.constants.php#constant.extr-prefix-invalid">EXTR_PREFIX_INVALID</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">

    </span>
   </dd>
  
  
   <dt id="constant.extr-prefix-if-exists">
    <strong><code><a href="array.constants.php#constant.extr-prefix-if-exists">EXTR_PREFIX_IF_EXISTS</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">

    </span>
   </dd>
  
  
   <dt id="constant.extr-if-exists">
    <strong><code><a href="array.constants.php#constant.extr-if-exists">EXTR_IF_EXISTS</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">

    </span>
   </dd>
  
  
   <dt id="constant.extr-refs">
    <strong><code><a href="array.constants.php#constant.extr-refs">EXTR_REFS</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">

    </span>
   </dd>
  
 </dl>
</div>
<?php manual_footer($setup); ?>