PHP generates the two-dimensional code

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Two dimensional code is now becoming more and more popular, the two-dimensional code introduces two PHP generated code, a use of Google open two-dimensional code API, another is using the PHP QR Code two-dimensional code open source library, is very simple.

1, Use Google Chart API to generate two-dimensional picture code

Google Chart API is a powerful API, generating a two-dimensional code is only a function of. Here only the two-dimensional code, if you want to know more, can log onto the website address: http://code.google.com/intl/zh-CN/apis/chart/

The following code:

<?php
$urlToEncode="";
generateQRfromGoogle($urlToEncode);
function generateQRfromGoogle($chl,$widhtHeight ='150',$EC_level='L',$margin='0')
{
 $url = urlencode($url);
 echo '<img src="http://chart.apis.google.com/chart?chs='.$widhtHeight.'x'.$widhtHeight.'&cht=qr&chld='.$EC_level.'|'.$margin.'&chl='.$chl.'" alt="QR code" widhtHeight="'.$size.'" widhtHeight="'.$size.'"/>';
}
?>

To generate two-dimensional picture code:

\"></p>
<p style=";
$errorCorrectionLevel = "L";
$matrixPointSize = "4";
QRcode::png($value, false, $errorCorrectionLevel, $matrixPointSize);
exit;
?>

To generate two-dimensional picture code:

\"></p>
<p style=PHP QR Code source code download (two-dimensional code generation library)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Philomena at December 13, 2013 - 6:44 AM