PHP產生QRCode二維碼

來源:互聯網
上載者:User

標籤:qrcode

<?php//引入 phpqrcode 類庫//phpqrcode:https://github.com/t0k4rt/phpqrcoderequire_once "phpqrcode/qrlib.php";//第一種(預設下在網頁中產生二維碼)//調用QRCode類下的png靜態方法QRcode::png("this is a qrcode");$content = "this is a qrcode";//內容$filename = time() . ".png";//檔案名稱$level = QR_ECLEVEL_L;//容錯層級$size = 10;//尺寸$padding = 3;//邊距//第二種(自訂下在網頁中產生二維碼)QRcode::png($content, false, $level, $size, $padding, true);//第三種(自訂下將產生的二維碼儲存為圖片檔案)QRcode::png($content, $filename, $level, $size, $padding, true);/*容錯層級QR_ECLEVEL_L 為常量 0 約可錯誤修正7%的資料碼字QR_ECLEVEL_M 為常量 1 約可錯誤修正15%的資料碼字QR_ECLEVEL_Q 為常量 2 約可錯誤修正25%的資料碼字QR_ECLEVEL_H 為常量 3 約可錯誤修正30%的資料碼字*/?>


本文出自 “tong707的部落格” 部落格,請務必保留此出處http://tong707.blog.51cto.com/12527988/1955424

PHP產生QRCode二維碼

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.