Need To Sort Out List Of Links Alphabetically..!

Discussion in 'PHP' started by Carly, Mar 19, 2008.

  1. #1
    Hello! I have a list of links to sort out, a rarther large list in fact.

    I'd like to sort them out alphabetically & don't know how to do this and keep the hyperlink intact.

    I tried using EXCEL to no avail, and was wondering if you know of a PHP way of doing this.

    Any suggestions will be MORE then appreciated! Thank you!

    :)
     
    Carly, Mar 19, 2008 IP
  2. PaddyL

    PaddyL Active Member

    Messages:
    69
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    50
    #2
    Can you give us specific information?
    • For example, how is the list held: On a MySQL database, in a text file, etc?
    • How many items are in the list (100's, thousands...)?
    • Do you have a description with a link, and is there any other information held that needs sorting with it?
    • Do you need it sorted by link, by description, or what?
    • Anything else you think we should know?
     
    PaddyL, Mar 19, 2008 IP
  3. Carly

    Carly Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you for your response!

    The list is currently held on a web page, with php extension.

    It is just a list of links to other sites, but obviously we'd need to sort out the description (not the anchor) whilst keeping the link intact.

    If I drop the list into MS EXCEL it removes the link, and we can only organise the text part.

    If I use a php script to sort the array of links it will sort the link/anchor (which is first in the code -
    <a href="001.php">blah b d </a>,  
    HTML:
    which I don't need it to.

    Does this make sense?
     
    Carly, Mar 19, 2008 IP
  4. PaddyL

    PaddyL Active Member

    Messages:
    69
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    50
    #4
    You'd need to write a short program to take the list, separate the description from the HTML, sort, and put them back together again.

    You can do that in Excel itself, but it's many years since I wrote an Excel macro so I don't remember how to do it. Perhaps some kindly soul on this forum will give you something simple.
     
    PaddyL, Mar 19, 2008 IP
  5. 9450184

    9450184 Peon

    Messages:
    30
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Can you show us the list or a part of it? :)
     
    9450184, Mar 19, 2008 IP