Storing an image from a link in PHP -
A direct link for an image is given, how can I store the actual image on a folder I created on my server Php?
Thanks
$ image_url = 'http: // example. Com / image.jpg '; $ Image = file_get_contents ($ image_url); File_put_contents ('/ my / path / image.jpg', $ image);
In a walnut, grab the image, store the image .. It's easy.
Note: allow_url_fopen should be set to correct for php.ini setting. Example above to work.
Comments
Post a Comment