PHP code example of keinx / think-qrcode

1. Go to this page and download the library: Download keinx/think-qrcode library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

keinx / think-qrcode example snippets


$code = new Qrcode();
$code_path = $code->png('text')                     //生成二维码
    ->logo('static/image/logo.png')                 //生成logo二维码
    ->background(180, 500)                          //给二维码加上背景
    ->text($role, 20, ['center', 740], '#ff4351')   //添加文字水印
    ->text($nick_name, 20, ['center', 780], '#000000')
    ->getPath();                                    //获取二维码生成的地址