<code class="php"><?php function saveImage($path) { if(!preg_match('/\/([^\/]+\.[a-z]{3,4})+\?.*?$/i',$path,$matches)) die('Use image please'); $image_name = strToLower($matches[1]); $img = file_get_contents($path); $fp = fopen($image_name,'w'); fwrite($fp, $img); fclose($fp); //unlink($image_name); } saveImage('http://img.v2.shunliandev.com/uploads/20200415/20200415141847617v.png?w=750&h=350');