To provide a QR code interface for the mobile app, you must support iso, android, and win8 mobile phones. You have found the third-party tool phpqrcode.
1. Download address
Source code download: https://github.com/t0k4rt/phpqrcode
2. Add watermark image and fragment code
The code is as follows: |
Copy code |
$ Logo = 'logo.png '; If (is_file ($ logo )) { $ QR = imagecreatefromstring (file_get_contents ($ filename )); $ Logo = imagecreatefromstring (file_get_contents ($ logo )); $ QR_width = imagesx ($ QR ); $ QR_height = imagesy ($ QR ); $ Logo_width = imagesx ($ logo ); $ Logo_height = imagesy ($ logo ); $ Logo_qr_width = $ QR_width/5; $ Scale = $ logo_width/$ logo_qr_width; $ Logo_qr_height = $ logo_height/$ scale; $ From_width = ($ QR_width-$ logo_qr_width)/2; Imagecopyresampled ($ QR, $ logo, $ from_width, $ from_width, 0, 0, $ logo_qr_width, $ logo_qr_height, $ logo_width, $ logo_height ); Imagepng ($ QR, $ filename ); } |