Methods for generating PHP QR codes (googleAPi, PHP class library, libqrencode, etc.)

Methods for generating PHP QR codes (googleAPi, PHP class library, libqrencode, etc.)

==============================================PHP How to use================================================ == 1. Use google open API to complete [php] $urlToEncode=”name:Liu Xinming,phone:18792448443″; generateQRfromGoogle($urlToEncode); /** * google api QR code generation [QRcode can store up to 4296 alphanumeric characters of any text, please check the QR code data format for details] * @param string $chl The information contained in the QR code can be numbers, characters, binary information, or Chinese characters. Data types cannot be mixed, and the data must be UTF-8 URL-encoded. If the information that needs to be transferred exceeds 2K bytes, please use the POST method * @param int $widhtHeight Size setting for generating QR code * @param string $EC_level Optional error correction level. QR code supports four levels of error correction, which is used to recover lost, misread, ambiguous, and data. *                          L-Default: Can identify 7% of the data that has been lost * M-can identify data that has lost 15% * Q-can identify data that has lost 25% * H-Can identify data that has lost 30% * @param int $margin The distance between the generated QR code and the image border */ function generateQRfromGoogle($chl,$widhtHeight ='150',$EC_level='L',$margin='0') { $chl = urlencode($chl); echo ''; } For more details, please refer to Baidu Library: http://wenku.baidu.com/view/b2a6ffc60c22590102029dae.html 2. PHP…

Methods for generating PHP QR codes (googleAPi, PHP class library, libqrencode, etc.)

==============================================PHP How to use================================================ == 1. Use google open API to complete [php] $urlToEncode=”name:Liu Xinming,phone:18792448443″; generateQRfromGoogle($urlToEncode); /** * google api QR code generation [QRcode can store up to 4296 alphanumeric characters of any text, please check the QR code data format for details] * @param string $chl The information contained in the QR code can be numbers, characters, binary information, or Chinese characters. Data types cannot be mixed, and the data must be UTF-8 URL-encoded. If the information that needs to be transferred exceeds 2K bytes, please use the POST method * @param int $widhtHeight Size setting for generating QR code * @param string $EC_level Optional error correction level. QR code supports four levels of error correction, which is used to recover lost, misread, ambiguous, and data. *                          L-Default: Can identify 7% of the data that has been lost * M-can identify data that has lost 15% * Q-can identify data that has lost 25% * H-Can identify data that has lost 30% * @param int $margin The distance between the generated QR code and the image border */ function generateQRfromGoogle($chl,$widhtHeight ='150',$EC_level='L',$margin='0') { $chl = urlencode($chl); echo ''; } For more details, please refer to Baidu Library: http://wenku.baidu.com/view/b2a6ffc60c22590102029dae.html 2. PHP…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索