SEO Forums















                                          
User   Password   remember     (register)  ?

PHP sort


Back to php.


moderator    (2008-08-02)

moderator

 
PHP sort

Definition and Usage

The sort() function sorts an array by the values. This function assigns new keys for the elements in the array. Existing keys will be removed. This function returns TRUE on success, or FALSE on failure.

Syntax

sort(array,sorttype)

array : Required. Specifies the array to sort

sorttype : Optional. Specifies how to sort the array values. Possible values:

* SORT_REGULAR - Default. Treat values as they are (don't change types)
* SORT_NUMERIC - Treat values numerically
* SORT_STRING - Treat values as strings
* SORT_LOCALE_STRING - Treat values as strings, based on local settings


<?php
$my_array = array("a" => "Hamburger", "b" => "Cheese", "c" => "Jam");

sort($my_array);
print_r($my_array);
?>


The output of the code above will be:

Array
(
[0] => Cheese
[1] => Hamburger
[2] => Jam
)



ficgs
Suggestions

 Handy PHP - Array Sort By Day
www.handyphp.com/index.php/PHP-Resources/Handy-PHP-Functions/array_sort_by_

 InterfaceLIFT: ShapeShifter Mac OS X Themes (by date)
interfacelift.com/themes-mac/

 PHP Sort Class (sort, sort array, array sort) - PHP Classes
www.phpclasses.org/browse/package/4868.html

 PCI Vendor and Device Lists
www.pcidatabase.com/vendors.php?sort=id

 Download PHP Sort Class 0.8 - This PHP class can be used to sort array data using several types of sorting algorithms. - Softpedia
webscripts.softpedia.com/script/PHP-Clases/PHP-Sort-Class-50834.html

  Sorting 2D-arrays in PHP - anectodes and reflections | ProDevTips - dev notes and tutorials
www.prodevtips.com/2008/01/06/sorting-2d-arrays-in-php-anectodes-and-reflec



ficgs
More suggestions

This is a collaborative page, you may change the order of these suggestions by registering, then clicking the icons before the titles.


 PHP Sort Class | freshmeat.net
freshmeat.net/projects/sortclass

 WordPress › Support » how to get search.php to sort results by category
wordpress.org/support/topic/221314

 The Prime Glossary: sieve of Eratosthenes
primes.utm.edu/glossary/page.php?sort=SieveOfEratosthenes

 W5YI : Products Catalog
www.w5yi.org/catalog.php?sort=4

 The LiveCD List
www.livecdlist.com/

 PHP - setting sort order with an associative array
www.wellho.net/mouth/603_PHP-setting-sort-order-with-an-associative-array.h

 PhpDig.net - PHP - sort
www.phpdig.net/ref/rn03re57.html

 Javascript equivalent for PHP's sort
kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_sort

 userlist.php & "User list sort order" markup weirdness (Page 1) - PunBB 1.3 additions - PunBB Forums
punbb.informer.com/forums/topic/21393/userlistphp-user-list-sort-order-mark

 Thread Detail Page
techrepublic.com.com/5208-9592-0.html?forumID=88&threadID=197240

 PHPXRef 0.7 : Mambo 4.6.5 : Detail view of sort.action.php
mambo-developer.org/api/administrator/components/com_languages/actions/sort

  PHP dollar value sort error [Archive] - CodingForums.com
www.codingforums.com/archive/index.php/t-137534.html

 PHP and SQL- Sorting data in a table dynamically : php, sort, table, sql
www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Da

 Sorting an Array in PHP | Fatboys | sort, array, alphabetically, numerically, ascending, descending, narray, $narray, associative,arsort, krsort,arsor...
fatboys.co.za/content/view/70/1/

 Using Sort Function in PHP
www.akifkardas.com/2008/05/08/using-sort-function-in-php.html

  latesttopics.php error on sort by "rating" - vBadvanced Forums
www.vbadvanced.com/forum/showthread.php?t=13359

 Mantis "sort" PHP Code Execution Vulnerability - Secunia Advisories - Vulnerability Information - Secunia.com
secunia.com/advisories/32314/

 Threebyte » Strand sort presented in PHP
threebyte.eu/2008/07/30/strand-sort-presented-in-php/

 my first shot at my own php (sort of)... making a poll [Archive] - Mac Forums
forums.macrumors.com/archive/index.php/t-56758.html

 WBAI Archives and Podcasts
archive.wbai.org/index.php?sort=nameaz

  UMPC, Netbook and MID comparison, details and specifications website.
www.umpcportal.com/products/index.php?sort=id

 [#CONTRIB-440] sort out ajax.php and how it deals with quiz groups - Moodle Tracker
tracker.moodle.org/browse/CONTRIB-440



Response  
  Smilies

Guest name   (optional)       Register for more options.



Trackbacks : If you talked about this article in your blog or website, you may instantly get a backlink 
  There's no trackback at the moment.









 

FICGS message




SEO forums and chat - Search engines optimization



 
Please download Flash player.
March 18, 2010

 

Buttons: Facebook, Twitter, MySpace, Google, Technorati, Yahoo buzz... Ficgs Facebook Myspace Twitter Google Technorati Stumble upon Delicious Digg Yahoo buzz Wikio Furl Reddit Linkedin Squidoo Newsvine Yahoo My Web Blogmarks Comments Blinklist Email

You comment I follow : Links included in comments will be "dofollow" if your post is not an obvious spam, comments are published instantly.


Write upside down to your contacts !
(works with Facebook, Twitter, MSN, Yahoo, MySpace, Hi5, Bebo, Youtube...)







FICGS is also a Free Internet Correspondence Games Server.

Here you can play Chess, Go & Poker Texas Holdem online for free in rated class tournaments and a unique world championship.

Free Internet Chess & Go Server


Feel free to link to FICGS :