<?php   
    $url = 'http://mf1905.com/upload/video_img/df3074c98ec5124ad47c52ff59f74e04_middle.jpeg';   
  
    function http_get_data($url) {   
           
        $ch = curl_init ();   
        curl_setopt ( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );   
        curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, false );   
        curl_setopt ( $ch, CURLOPT_URL, $url );   
        ob_start ();   
        curl_exec ( $ch );   
        $return_content = ob_get_contents ();   
        ob_end_clean ();   
           
        $return_code = curl_getinfo ( $ch, CURLINFO_HTTP_CODE );   
        return $return_content;   
    }   
       
    $return_content = http_get_data($url);   
    $filename = 'test.jpg';   
    $fp= @fopen($filename,"a"); //将文件绑定到流     
    fwrite($fp,$return_content); //写入文件   

 

相关文章:

  • 2022-01-30
  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案