CURL & Regex Help Needed

Discussion in 'PHP' started by crazyryan, Jul 24, 2008.

  1. #1
    solveddddddd
     
    crazyryan, Jul 24, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Set CURLOPT_RETURNTRANSFER to true.
     
    nico_swd, Jul 24, 2008 IP
  3. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #3
    Nice, stopped returning the page and fixed the regex issues. Cheers bud.

    EDIT: The code works but it returns:
    <blockquote><b>http://tinyurl.com/1c2</b><br><small>

    Is there anyway I can retrieve the URL only?

    EDIT2: Was using $matches[0], 1 worked.
     
    crazyryan, Jul 24, 2008 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    $matches[1] should hold just the URL, doesn't it?
     
    nico_swd, Jul 24, 2008 IP
  5. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #5
    Yeah, just realised, thanks
     
    crazyryan, Jul 24, 2008 IP