cc
胖大海API
二维码生成
快速将URL或者文字生成二维码
共调用149次
接口详情 二维码生成
请求参数说明
返回参数说明
返回示例
错误码格式说明:
代码示例
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
text | 是 | string | 输入内容 |
type | 否 | string | img,json可选,默认img |
名称 | 类型 | 说明 |
---|
{ "code": "200", "url": "http://api.suxun.site/cache/1702270041.png" }
名称 | 类型 | 说明 |
---|
HTML代码:
<img src="http://api.suxun.site/api/qrcode?text=内容" alt="胖大海API">
PHP代码:
<?php
$text = $_GET['text'];
$src = "http://api.suxun.site/api/qrcode?text=" . $text;
header('Content-type: image/png');
$res = imagecreatefromstring(file_get_contents($src));
imagepng($res);
imagedestroy($res);
?>