0

Possible Duplicate:
PHP save image file

I want to download images from another server. I have their http path. their is one way that I can download image by right click on it and save this image. but I want to same action with php coding. is there any method or any script which help or any idea which is useful in this action.

Cœur
  • 34,719
  • 24
  • 185
  • 251
mjdevloper
  • 1,533
  • 7
  • 33
  • 68

2 Answers2

1

If you want to download & save an image somwhere:

file_put_contents('/path/to/save/image', file_get_contents($imageurl));
Alex Bailey
  • 1,659
  • 10
  • 15
0

php has at least one simple function for that purpose:

$filecontent = file_get_contents($imageurl);
heximal
  • 10,049
  • 5
  • 42
  • 67