Document new sort_flags parameter for array_unique() in 5.2.9

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@271119 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kalle Sommer Nielsen 2008-12-13 05:32:05 +00:00
parent 6541d82802
commit fb32b71aef

View file

@ -1,15 +1,17 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.17 $ -->
<!-- $Revision: 1.18 $ -->
<refentry xml:id="function.array-unique" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>array_unique</refname>
<refpurpose>Removes duplicate values from an array</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>array_unique</methodname>
<methodparam><type>array</type><parameter>array</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>sort_flags</parameter></methodparam>
</methodsynopsis>
<para>
Takes an input <parameter>array</parameter> and returns a new array
@ -33,6 +35,7 @@
</simpara>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
@ -45,15 +48,73 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>sort_flags</parameter></term>
<listitem>
<para>
The optional second parameter <parameter>sort_flags</parameter>
may be used to modify the sorting behavior using these values:
</para>
<para>
Sorting type flags:
<itemizedlist>
<listitem>
<simpara><constant>SORT_REGULAR</constant> - compare items normally
(don't change types)</simpara>
</listitem>
<listitem>
<simpara><constant>SORT_NUMERIC</constant> - compare items numerically</simpara>
</listitem>
<listitem>
<simpara><constant>SORT_STRING</constant> - compare items as strings</simpara>
</listitem>
<listitem>
<simpara><constant>SORT_LOCALE_STRING</constant> - compare items as
strings, based on the current locale. Added in PHP 4.4.0 and 5.0.2.
Before PHP 6, it uses the system locale, which can be changed using
<function>setlocale</function>. Since PHP 6, you must use the
<function>i18n_loc_set_default</function> function.
</simpara>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the filtered array.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.2.9</entry>
<entry>
Added the optional <parameter>sort_flags</parameter>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
@ -105,6 +166,7 @@ array(2) {
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file