I have a picture url like this http://www.address.com/image.jpg
I want do dyn开发者_如何学编程amically save this image on my server
How can i achieve this using php
Thanks
You can get it using file_get_contents() and saving it using file_put_contents(). Something like:
$image = file_get_contents('http://www.address.com/image.jpg');
file_put_contents('image.jpg', $image);
You also might want look into cURL to fetch the image; it should perform better than file_get_contents() (unless you compile curl with --with-curlwrappers)
加载中,请稍侯......
精彩评论