Join Up!
104886 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previoussizeofuasortnext
Last updated: Tue, 29 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | German

sort

(PHP 3, PHP 4 )

sort -- Ordena una matriz

Descripción

void sort ( array matriz)

Esta función ordena una matriz. Los elementos estarán ordenados de menor a mayor cuando la función termine.

Ejemplo 1. Ejemplo de sort()

$frutas = array ("limón", "naranja", "plátano", "manzana");
sort ($frutas);
for (reset ($frutas); $clave = key ($frutas); next ($frutas)) {
    echo "frutas[$clave] = ".$frutas[$clave]."\n";
}
Este ejemplo mostrará: frutas[0] = limón frutas[1] = manzana frutas[2] = naranja frutas[3] = plátano Las frutas han sido ordenadas en orden alfabético.

Vea también: arsort(), asort(), ksort(), rsort(), y usort().

User Contributed Notes
sort
add a note about notes
There are no user contributed notes for this page.
previoussizeofuasortnext
Last updated: Tue, 29 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST