Get Images From Url

Discussion in 'PHP' started by Hobbit2, Jun 11, 2007.

  1. #1
    I'm trying to get certain images from a url. Can I use curl for this? Or what can I actually use to get images from a certain url? I'm barely learning php so I'm not sure.
     
    Hobbit2, Jun 11, 2007 IP
  2. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #2
    and by get images, you mean? you could scrape the page and get the relevant paths to the images and if you want copy them to a folder or something on your server and then shove them in a zip for download. i havent used the zip funcitions in php but it would come in handy for something like this i would imagine. this is of course if your intentions are downloading all of the images to your computer or server.
     
    ansi, Jun 11, 2007 IP
  3. mojojuju

    mojojuju Peon

    Messages:
    53
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah, you can use curl for this. wget will accomplish the task as well.
     
    mojojuju, Jun 12, 2007 IP
  4. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #4
    or just file_get_contents(url) but you must have allow_url_fopen enabled.
     
    gibex, Jun 12, 2007 IP
  5. *louie*

    *louie* Peon

    Messages:
    48
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I consider "curl" to be the best option. Had to do something similar myself and curl worked perfect.
     
    *louie*, Jun 12, 2007 IP