Home  >  Article  >  Backend Development  >  According to the picture address, save the picture to the local ins to save the picture software to save the picture word to save the picture

According to the picture address, save the picture to the local ins to save the picture software to save the picture word to save the picture

WBOY
WBOYOriginal
2016-07-29 08:52:031426browse
function getImg($url,$filename){
if($url == '')
return false;
//Open the output control buffer
Ob_start();
                                 Read the url image file and write it to the output cache
                                                                                                                                        readfile($url); /clear output cache Area content
                                                                                                                                                                                  Ob_end_clean();
            $imgdir = './';
                            $fp                                                                                                                               }
getImg('
http://ubmcmm.baidustatic.com/media/v1/0f000ntPpKn9AHLumTK7W6.jpg','1.jpg'); The above introduces how to save pictures to the local according to the picture address, including saving pictures and picture addresses. I hope it will be helpful to friends who are interested in PHP tutorials.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn