We need to use some class libraries to generate two-dimensional codes. The following describes how to generate two-dimensional codes using PHPQRCode. the generation method is very simple. I will introduce it below. Php class library PHPQRCode is used for implementation. no additional php extension is required... we need to use some class libraries to generate two-dimensional codes. The following describes how to generate two-dimensional codes using php qr codes. the generation method is very simple. I will introduce it below.
Php QR Code library is used for implementation. no additional PHP extension is required.
First, download the class library package. sometimes the address cannot be opened.
Address: http://phpqrcode.sourceforge.net/
Download: http://sourceforge.net/projects/phpqrcode/
The phpqrcode. php file is generally introduced for use.
Examples
Direct browser output:
Image file output
Generate a QR code with a central logo
"; $ Logo = 'bdlogo.gif '; $ QR = 'xiangyang.png'; if ($ logo! = FALSE) {$ QR = imagecreatefromstring (file_get_contents ($ QR); $ 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; image Copyresampled ($ QR, $ logo, $ from_width, $ from_width, 0, 0, $ logo_qr_width, $ logo_qr_height, $ logo_width, $ logo_height);} comment ');?>
Address:
Reprinted at will, but please attach the article address :-)