What is two-dimensional code:
Two-dimensional code is a two-dimensional barcode, can be the URL, text, photos and other information through the corresponding coding algorithm compiled into a block-shaped barcode pattern, mobile phone users can use the camera and decoding software to decode the relevant information and view the content.
Read mode:
Using 300,000 pictures of the camera phone, with the phone's QR code decoding software, the QR code a photo, decoding software will automatically read this message, displayed on the phone screen. At present there are also used to webcam lens to decode, it is expected that all the future of the lens of the technology products, will be imported into this QR code mechanism.
Two-dimensional barcode advantages:
1. Greater data capacity
2. Beyond the limits of alphanumeric
3. Small barcode Relative size
4. Have the ability to resist damage
Two-dimensional code generation
: https://chart.googleapis.com/chart?cht=qr&chs=150x150&choe=UTF-8&chld=L4&chl=http://blog.waphk.cn
Google Open API "PHP version"
Php <textarea data-settings="dblclick" readonly="" wrap="off"></textarea>
1 2 3 4 5 6 7 8 |
PHP Code $urlToEncode = "blog.php100.com"; Generateqrfromgoogle ($urlToEncode); function Generateqrfromgoogle ($chl, $widhtHeight = ' m ', $EC _level= ' L ', $margin = ' 0 ') {$url = UrlEncode ($url); Echo ' < IMG src= "https://chart.googleapis.com/chart?cht=qr&chs= '. $widhtHeight. ' x '. $widhtHeight. ' &chl= '. $chl. ' &chld= '. $EC _level. $margin. ' alt= ' QR code ' widhtheight= '. $size. ' widhtheight= '. $size. ' " /> '; } |
Parameter 1 cht Specify a QR code
Parameter 2 CHS image size, which is said to generate picture size is 200x200, is wide x high. This is not the real size of the generated picture, it should be the maximum size.
Parameter 3 CHL The specified data, which is the information that is seen after decoding. When you include Chinese, use UTF-8 to encode Chinese characters, otherwise there will be a problem.
There are two optional parameters
Choe Encoding Default UTF8
CHLD Error Correction default 7% L represents the default error correction level, 4 represents the two-dimensional code boundary blank size, can be adjusted.