Gold Vision Communications / USA
 GOLDVISION.COM
Serving the Multimedia Community since 1989.
German Site | Spanish Site 

 Web Hosting

 Virtual Dedicated Servers

 Domaincheck

 Order

 Order Status

 Support

 Contact us

 Download

 Network

 Network Status

 Webdesign / Templates

 Make Payment

 Terms & Conditions

 Imprint

 Legal Notices

 Privacy Statement
  PHP / ksort
ksort

ksort

(PHP 3, PHP 4 )

ksort -- Ordena una matriz por clave

Descripción

int ksort ( array matriz)

Ordena una matriz por clave, manteniendo las correlaciones clave a dato. Esto es útil principalmente en matrices asociativas.

Ejemplo 1. Ejemplo de ksort()

$frutas = array ("d"=>"limón", "a"=>"naranja", "b"=>"plátano", "c"=>"manzana");
ksort ($frutas);
for (reset ($frutas); $clave = key ($frutas); next ($frutas)) {
    echo "frutas[$clave] = ".$frutas[$clave]."\n";
}
Este ejemplo mostrará: frutas[a] = naranja frutas[b] = plátano frutas[c] = manzana frutas[d] = limón

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


© 1998-2007 Gold Vision Communications All Rights Reserved.