This article summarizes two methods for generating QR code images using php. one is to use Google api and the other is a practical phpqrcode class library, which is very convenient, if you have a need, refer to the first method below:
1. Method 1: Use the most widely used and convenient Google api technology;
2
,
/* Note: first construct the content string to call the function to generate * // Construct the content string $ content = "public platform: thinking and logic rn public account: siweiyuluoji "; // call the function to generate a QR code image echo create_erweima ($ content); // Generate a QR code for the url; $ url = "http://jingyan.baidu.com/article/0964eca23c39ce8285f5363c.html"; $ url. = "rn"; $ url. = "http://jingyan.baidu.com/article/03b2f78c4d28ae5ea237ae15.html"; echo create_erweima ($ url);?>
Method 2:
Download and decompress the file, and copy (or copy) the phpqrcode folder to the project;
,
For more articles about how to generate a QR code image by using php, refer to the Chinese PHP website!