In php how to get URL fetches from the document?

Discussion in 'PHP' started by mudassarahmad, May 31, 2008.

  1. #1
    Any body work with url fetch from the document URLS.
     
    mudassarahmad, May 31, 2008 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Use regular expression to parse the document. You can find tons of examples/classes which can do this for you. www.phpclasses.org have many php classes available for this purpose.
     
    mwasif, Jun 1, 2008 IP
  3. nikec

    nikec Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    use preg_match function in php to put them in an array

    preg_match("/^(http:\/\/)?([^\/]+)/i", $source, $urls); //not sure if this is the right code
     
    nikec, Jun 1, 2008 IP