Home > Backend Development > PHP Tutorial > Detailed explanation of the implementation code for generating QR code (google api) online with PHP_PHP tutorial

Detailed explanation of the implementation code for generating QR code (google api) online with PHP_PHP tutorial

WBOY
Release: 2016-07-21 15:09:02
Original
1136 people have browsed it

Generate QR codes online through Google’s API for generating QR codes online.
The code is as follows:

Copy code The code is as follows:





QR code generation-www.jbxue.com





$content=$_GET[' content'];
$width=$_GET['width']?$_GET['width']:300;
$height=$_GET['height']?$_GET['height']: 300;
if($content){
echo "The text you entered is: $content
";
echo "The width you selected Is: $width
";
echo "The height you selected is: $height
" ;
echo "The generated QR code image is:
";
$wen = urlencode(mb_convert_encoding($content, 'utf-8', 'gb2312'))."";
echo "< ;br />
Image address:https://chart.googleapis.com/chart?cht=qr&chld=H&chs={$width}x{$height}&chl={$wen}

Copy and send to your friends. Return to the previous page";
}else{
?>


QR code generation tool


width:
height:


Enter the URL or text:









< div>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327369.htmlTechArticleGenerate QR code online through Google’s online QR code generation API. The code is as follows: Copy the code The code is as follows: !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template