您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 昌都分类信息网,免费分类信息发布

php根据url生成网页快照的方法(附代码)

2024/5/28 20:01:19发布19次查看
这篇文章主要介绍了php根据url生成网页快照的方法,有一定的参考价值,感兴趣的朋友可以参考一下。<form method="post" action=""><input type="text" name="url" /><input type="submit" value="提交" /></form><?php/* 网页截图功能,必须安装ie+cutycapturl:要截图的网页out:图片保存路径path:cutycapt路径cmd:cutycapt执行命令比如:http://你php路径.php?url=http://www.xxx.com*/function generatepictures($url){$url=$url;$imgname=str_replace('http://','',$url);$imgname=str_replace('https://','',$imgname);$imgname=str_replace('.','-',$imgname);$out = 'd:/gongzuo/tupian/'.$imgname.'.png';$path = 'd:/cutycapt.exe';$cmd = "$path --url=$url --out=$out";echo "<img src='http://localhost/tupian/".$imgname.".png' />";system($cmd);}if (isset($_post['url'])) { generatepictures($_post['url']); }?>
【相关教程推荐】
1. php编程从入门到精通全套视频教程
2. php从入门到精通 
3. bootstrap教程
昌都分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录