Home >Backend Development >PHP Tutorial >Example of using google api to generate QR code business card_PHP tutorial
Two-dimensional barcode/QR code can be divided into stacked/lined two-dimensional barcode and matrix two-dimensional barcode. The stacked/lined two-dimensional barcode is formed by stacking multiple rows of short one-dimensional barcodes; the matrix two-dimensional barcode is composed in the form of a matrix, and "dots" are used to represent binary "1" at the corresponding element positions of the matrix. ", using "empty" to represent binary "0", the arrangement of "dot" and "empty" constitutes the code.
Stacked/lined 2D barcodes, such as Code 16K, Code 49, PDF417, etc.
The most popular matrix QR code is QR CODE.
Matrix QR codes store a larger amount of data; they can contain mixed content such as numbers, characters, and Chinese text; they have a certain degree of fault tolerance (can be read normally after some damage); they have high space utilization, etc.
The code is as follows | |
代码如下 | |
$vname = 'test'; function generateQRfromGoogle($vname,$vtel,$widhtHeight ='150',$EC_level='L',$margin='0')
|
$vname = 'test';
代码如下 | ||||||
$url = "http://www.google.com.hk"; generateQRfromGoogle($url); function generateQRfromGoogle($chl,$widhtHeight ='150',$EC_level='L',$margin='0')
Example
If you want to achieve the effect of having a logo in the middle, you need to splice it with another small logo image. Only one implementation method is provided here, and it can also be generated through QRcode. For standard information on vcode, please refer to Wikipedia. Note: Some generated pictures do not have data after scanning because of encoding. This problem is more common under windows. Since many editors provide ANSI encoding by default, changing it to utf8 is OK. Articles you may be interested in
Statement: The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn Previous article:PHP magic_quotes_gpc_PHP tutorialNext article:PHP magic_quotes_gpc_PHP tutorial Related articlesSee more |