How to retrieve urls behind redirects?

Discussion in 'PHP' started by BananaSoup, May 8, 2008.

  1. #1
    I've got a list of over 7000 redirects, like:
    http://domain.com/redirect.php?id=0001
    http://domain.com/redirect.php?id=0002
    etc.

    (also have this list in a PHP array)

    And I need to process this into a list of the actual destination url's (they're all different domains). I can't figure out how to do it. Anaybody have any tips?
     
    BananaSoup, May 8, 2008 IP
  2. ksamir2004

    ksamir2004 Peon

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    I think if you have 7000 redirect. then you can use
     
    ksamir2004, May 8, 2008 IP
  3. BananaSoup

    BananaSoup Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you, Ksamir.

    When I tried your code what happened was that my browser visited the first url in the array and stopped there. Now I still need to make it so that all urls are visited and stored, either in a database or an array. Any help is greatly appreciated!
     
    BananaSoup, May 8, 2008 IP