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
  • 37,241
  • 25
  • 195
  • 267
mjdevloper
  • 1,553
  • 8
  • 33
  • 69

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,679
  • 10
  • 15
0

php has at least one simple function for that purpose:

$filecontent = file_get_contents($imageurl);
heximal
  • 10,327
  • 5
  • 46
  • 69