★ wanayoo — archive 1999 http://il.php.net/manual/function.sort.php3Nouvelle recherche | Portail wanayoo

PHP3 Home Page

Manual Table of Contents
Up to Arrays
Quick Reference
Arrays
* array
* array_walk
* arsort
* asort
* count
* current
* each
* end
* key
* ksort
* list
* next
* pos
* prev
* range
* reset
* rsort
* shuffle
* sizeof
* sort
* uasort
* uksort
* usort
Manual: sort
View the source code for this pageSearch the site



Previous page
 sizeof
uasort 
Next page


sort

sort -- Sort an array

Description

void sort(array array);

This function sorts an array. Elements will be arranged from lowest to highest when this function has completed.

Example 1. sort() example

$fruits = array("lemon","orange","banana","apple");
sort($fruits);
for(reset($fruits); $key = key($fruits); next($fruits)) {
    echo "fruits[$key] = ".$fruits[$key]."\n";
}
This example would display: fruits[0] = apple fruits[1] = banana fruits[2] = lemon fruits[3] = orange The fruits have been sorted in alphabetical order.

See also arsort(), asort(), ksort(), rsort(), and usort().


 About Notes


Previous page
 sizeof
uasort 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
Israel
Some elements of this website are subject to copyright.