#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    27
    Rep Power
    0
    I have an array filled with integers. How can i display these integers lowest first, highest last? (like mysql order by)

    Pieter
  2. #2
  3. No Profile Picture
    Robert_J_Sherman
    Guest
    Devshed Newbie (0 - 499 posts)
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by pieter guis:
    I have an array filled with integers. How can i display these integers lowest first, highest last? (like mysql order by)

    Pieter
    [/quote]

    Try using the ORDER BY

    ASC &#0124; &#0124; DESC depending on which way you want
    the results listed.



    ------------------
    SnR Graphics,
    Low Cost Hosting and Web Development.
  4. #3
  5. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Pieter,

    I think sort() function will work for you..

    <?
    $values = array("1", "3", "4", "5","6","2");
    sort ($values);

    //this will sort an array.elements will be arranged from lowest to highest...
    ?>


    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."

    [This message has been edited by Shiju Rajan (edited August 02, 2000).]

Similar Threads

  1. basket contents display doesnt update
    By SeenGee in forum PHP Development
    Replies: 1
    Last Post: February 20th, 2004, 11:03 AM
  2. sort: find duplicate string elements in array
    By sciencelife in forum Java Help
    Replies: 3
    Last Post: January 27th, 2004, 01:29 PM
  3. return contents of directory in array
    By jacen6678 in forum C Programming
    Replies: 1
    Last Post: January 26th, 2004, 03:32 PM
  4. returning contents of a directory as an array
    By c0ldshadow in forum C Programming
    Replies: 4
    Last Post: January 15th, 2004, 08:51 PM
  5. Replies: 3
    Last Post: December 24th, 2003, 03:23 PM

IMN logo majestic logo threadwatch logo seochat tools logo