SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Problem with sorting array

    Let's say i have an array of data,for example;
    $tasktimes = {0.6,1.2 ,0.3,1.0}. how can i sort this array from the smallest value to the biggest value? i mean like this,$tasktimes = {0.3,0.6,1.0,1.2}.
    does php have any function for this?

  2. #2
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can use

    sort();

    function, for full details read the good book

    http://www.php.net/manual/en/function.sort.php
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •