PHP获取当前网页的二维码
获取网址二维码 跟前几天的QQ头像获取一个道理 对接别人的接口 也就是中转别人的接口 化为自己的接口 接口源码调用的是网址二维码 如果接口失效了 大家可以替换接口源码的接口地址 另外我附了几个网址二维码接口
PHP
<?php
/**
* 获取网址二维码
* 晓超云博客
* 2018-11-21
* https://www.tx47.cn
* 切勿修改版权可以删除谢谢
*/
$url = $_GET['url'];
$src = 'https://api.tx7.co/qrcode.php?url='.$url.'';
error_reporting(0);
$res = imagecreatefromstring(file_get_contents($src));
if(!$url)
{
echo '{"code":201,"msg":"请填写域名"}';
exit;
}else{
header('Content-type: image/png');
imagepng($res);
}
?>
API接口:
http://bshare.optimix.asia/barCode?site=weixin&url=
https://www.kuaizhan.com/common/encode-png?large=true&data=
https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=
https://sapi.k780.com/?app=qr.get&data=
http://qr.liantu.com/api.php?text=
https://api.tx7.co/qrcode.php?url=
接口调用:
你的网站/qrcode.php/?url=你要调用网址
接口保存PHP文件 命为qrcode
来自晓超云博客-原文地址:https://www.tx47.cn/xcbk-455.html
评论