顯示不出來。。。
<?php
$url = 'http://www.iyi8.com/uploadfile/2014/0521/20140521105216901.jpg';
$content = file_get_contents($url);
$filename = 'E:\phpstudy\mysql\WWW\article\tmp.jpg';
file_put_contents($filename, $content);
$url = 'http://www.iyi8.com/uploadfile/2017/0110/20170110104858707.jpg';
file_put_contents('E:\phpstudy\mysql\WWW\article\logo.png', file_get_contents($url));
//開始添加水印操作
$im = imagecreatefromjpeg($filename);
$logo = imagecreatefrompng('E:\phpstudy\mysql\WWW\article\logo.png');
$size = getimagesize('E:\phpstudy\mysql\WWW\article\logo.png');
imagecopy($im, $logo,10, 10, 0, 0,520, 520);?
?
header("content-type: image/jpeg");
imagejpeg($im, $filename);
imagejpeg($im);
imagejpeg($filename);
2017-03-04
你可以把代碼復(fù)制到本地,打開你本地的服務(wù)器,沒有的話,下載一個,比如xammp,新建一個PHP文件到xammp的htdoc下面,就可以通過瀏覽器打開localhost/你的文件路徑查看