<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="arrayobject.asort" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>ArrayObject::asort</refname>
  <refpurpose>Sort the entries by value</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis role="ArrayObject">
   <modifier>public</modifier> <type>true</type><methodname>ArrayObject::asort</methodname>
   <methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer><constant>SORT_REGULAR</constant></initializer></methodparam>
  </methodsynopsis>
  <para>
   Sorts the entries in ascending order,
   such that its keys maintain their correlation with the values they
   are associated with.
  </para>
  <para>
   This is used mainly when sorting associative arrays where the actual
   element order is significant.
  </para>
  &note.sort-unstable;
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   &sort.flags.parameter;
  </variablelist>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   &return.true.always;
  </para>
 </refsect1>

 <refsect1 role="changelog">
  &reftitle.changelog;
  <para>
   <informaltable>
    <tgroup cols="2">
     <thead>
      <row>
       <entry>&Version;</entry>
       <entry>&Description;</entry>
      </row>
     </thead>
     <tbody>
      &return.type.true;
     </tbody>
    </tgroup>
   </informaltable>
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>ArrayObject::asort</function> example</title>
    <programlisting role="php">
<![CDATA[
<?php
$fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple");
$fruitArrayObject = new ArrayObject($fruits);
$fruitArrayObject->asort();

foreach ($fruitArrayObject as $key => $val) {
    echo "$key = $val\n";
}
?>
]]>
    </programlisting>
    &example.outputs;
    <screen>
<![CDATA[
c = apple
b = banana
d = lemon
a = orange
]]>
    </screen>
    <para>
     The fruits have been sorted in alphabetical order, and the key
     associated with each entry has been maintained.
    </para>
   </example>
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><methodname>ArrayObject::ksort</methodname></member>
    <member><methodname>ArrayObject::natsort</methodname></member>
    <member><methodname>ArrayObject::natcasesort</methodname></member>
    <member><methodname>ArrayObject::uasort</methodname></member>
    <member><methodname>ArrayObject::uksort</methodname></member>
    <member><function>asort</function></member>
   </simplelist>
  </para>
 </refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
