Posted in PHP onFebruary 18, 2014
<?php $domain ='https://3water.com'; $url = '/newskin/images/v4/logo.jpg'; $pats = pathinfo($url); $dir = '.'.$pats['dirname'].'/'; if(!is_dir($dir)) { @mkdirs($dir, 0777); @fclose(fopen($dir.'/index.htm', 'w')); } $img = file_get_contents($domain.$url); file_put_contents('.'.$url,$img); echo '<img src="'.$url.'">'; function mkdirs($pathname, $mode = 0755){ is_dir(dirname($pathname)) || mkdirs(dirname($pathname), $mode); return is_dir($pathname) || @mkdir($pathname, $mode); } ?>
phpphp图片采集后按原路径保存图片示例
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@