- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将一些数据转换为网页上的二维码。为此,我使用“php 二维码”。
图书馆的 Sourceforge 主页:http://phpqrcode.sourceforge.net/
我无法使用库生成二维码。我缺少 PHP 扩展吗?
以为我错过了 GD2 扩展,我做到了:
brew install gd
当前代码:
include( '../phpqrcode/qrlib.php' );
QRcode::png( 'PHP QR Code : )' );
当前输出:
�PNG IHDRWWKK/PLTE���U���~�IDAT8����PG.�N�t�tـ,V��H,pe�����4Ĵq�k���j� ��'^l������p��h��Sn��8D>3T-��%����:\��z����4{oL��!C��-����_o. r����r��m����x+��,}��ő��|i����ʚt{oZ6\,i��{��5몏{����Ϫ����/MIEND��B `�
编辑:我试过将 html header 更改为 image/png。相同的结果。
<meta http-equiv="content-type" content="image/png" charset="UTF-8">
编辑:完整的示例代码,相同的结果,没有二维码。
<?php header('Content-type: image/png'); ?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta http-equiv="content-type" content="image/png" charset="utf-8">
<title></title>
</head>
<body>
<?php
include( '../phpqrcode/qrlib.php' );
QRcode::png( 'PHP QR Code : )' );
?>
</body>
</html>
编辑:以下显示相同的结果
<?php
header('Content-type: image/png');
include( '../phpqrcode/qrlib.php' );
QRcode::png( 'PHP QR Code : )' );
?>
编辑:使用 laravel 框架
最佳答案
试试这个:
<?php
header('Content-Type: image/png');
include( '../phpqrcode/qrlib.php' );
QRcode::png( 'PHP QR Code : )' );
?>
输出图像时,不需要 HTML 标签。或者,您可以将 img
标记与 data:...
源一起使用。有关示例,请参阅 here .
关于php - 如何使用 PHP 生成二维码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49519102/
可以在 R 中生成二维码吗?是否有允许它的包? 最佳答案 现在在 CRAN 您可以使用 qrencoder包 - https://github.com/hrbrmstr/qrencoder - 这样做
我有一个使用相机扫描二维码的应用程序。当我打开应用程序并转到二维码阅读器时,一切正常。一旦我扫描代码,信息就会发送到另一个 Activity ,但是一旦我点击后退按钮,相机就会变黑(见下文),我就无法
有没有办法为一个二维码创建多个 Action ? 目标是扫描二维码并执行这些操作: 连接WIFI 转至特定网址 我可以用 2 个二维码完成这 2 个操作,但只有一个会更容易 最佳答案 你不能。 仅仅是
在我的应用程序中,我需要实现 Blackberry Messenger 中可用的功能,即用户可以通过扫描他们的 QR 码来添加其他用户。 我找到了可以帮助生成二维码的库,也找到了线程来帮助生成二维码。
我尝试了新的 Google Play 服务功能 - 条码/QR 扫描仪。在 sample应用程序通过点击按钮开始扫描,结果也会在点击时返回。 有没有办法改变它的行为以立即返回第一个检测到的条形码/二维
我正在寻找解密(不仅是解码)二维码的逻辑。最近我看到几个加密二维码的应用程序,比如QuickMark。 .例如,此 QR 使用密码“pass”解密为“StackOverflow”: 如果你使用一个没有
我的公司有一个通过 URL 访问的社交网络平台。 我们正在尝试找到一种方法在体育商店中宣传我们的 URL,只有您来到商店才能访问我们的网站 - 我们不希望将 URL 分享给任何地方的任何人。 我们考虑
我想根据字段卷号生成一个二维码,并使用 JavaScript 文件(客户端验证)将其显示在 ID 名为“vyas_qrcode”的 div 容器中。 生成二维码的逻辑在js文件(qrcode_js.j
我正在研究使用 Android、iOS 和可能的 Windows Phone 上的浏览器扫描二维码的可用方法。理想的解决方案是拥有一个既可以在移动设备屏幕上又可以在全尺寸计算机屏幕上运行的 Ang
我正在开发 Instagram、Snap Chat 和 Facebook 等社交应用。我需要生成用户配置文件的二维码。我从数据库中隐藏了用户 ID。我的应用程序中有一个扫描仪来扫描二维码。该功能运行良
我有一个用于生成 jpeg 和 png 格式的二维码的代码,但还想在 PHP 中生成带有背景图像的 svg 二维码。我正在使用 qrlib.php 生成 jpeg 和 png 格式。 最佳答案 QRl
我正在使用 primefaces 开发网络应用程序。我正在尝试在网页上显示条形码。除了 QR 码外,所有编码器都显示了。我读到这需要两个 jar 文件 barcode4j: 2.1 qrgen:1.4
我正在寻找一个库或方法来解码二维码(或可能是另一种形式的二维条码)并能够实际确定相机的位置和方向。这似乎应该是可行的,但我不完全确定。 有谁知道最好的路线是什么?或者,如果它甚至可能? 最佳答案 zx
我正在尝试创建一个 QR 码,如果在安装了 Facebook 应用程序的手机上扫描,Facebook 应用程序将直接转到 QR 码中保存的类似页面。我尝试过什么this website已经说过了,但没
我使用python-qrcode和reportlab,我想生成一个二维码并显示它而不是将它保存为图像。 def member_card(request): response = HttpRes
好的,我正在使用这个 Javascript QR 代码生成器:https://github.com/davidshimjs/qrcodejs 开箱即用,您可以通过将其包含在页面上来获得字符串输出。
我在检测二维码在哪里时遇到问题。 我需要在它周围画边框。 我使用 AVMetadataObject 贝塞尔曲线路径,但它不起作用。 请帮助我。 - (void)captureOutput:(AVCap
我正在使用已弃用的 Camera 类。我在 onPreviewFrame(byte[] data, Camera camera) 方法中进行处理。 Zbar 扫描仪没有触发“尝试反向”扫描的选项。我发
1、搭个界面 2、写代码 ? 1
我正在尝试使用 pyqrcode 库生成一个 vCard 二维码,但我不知道该怎么做。 我已经阅读了他们的文档 5 次,其中没有提到 vCard,只提到了 URL,在互联网上,我只能找到关于 wifi
我是一名优秀的程序员,十分优秀!