PHP Get Remote Picture code example:
- function Gethttpimage ($url) {
- Set_time_limit (0);
- if (!empty ($url)) {
- $ Imgurl = Date (' Y-m ', Time ()). ' /'.
Uniqid (). STRRCHR ($url, ".");
- $ Imgpath = App_path .' /public
/uploads/';
- $ filename = $imgPath. $imgUrl;
- if (!is_dir ($imgPath)) @mkdir
($imgPath, 0777);
- $ Get_file = @file_get_
Contents ($url);
- if ($get _file) {
- $ FP = @fopen ($filename, "w");
- @fwrite ($fp, $get _file);
- @fclose ($FP);
- }
- return $IMGURL;
- }else{
- return false;
- }
- }
The above code is an introduction to the method of obtaining remote images from PHP.
http://www.bkjia.com/PHPjc/445976.html www.bkjia.com true http://www.bkjia.com/PHPjc/445976.html techarticle PHP gets a remote picture code example: Functiongethttpimage ($url) {set_time_limit (0), if (!empty ($url)) {$ imgurl = date (' Y-m ', Time ()). ' /'. Uniqid (). STRRCHR ($url,.); $ imgpath = App_ ...