Generating QR Code with PHP

To generate QR Code there are a lot of libraries but I want to show you the easiest way to generate QR Code which is using googleapis

We start with determining the value of the height and width.

function qrCode($s, $w = 250, $h = 250){
	$u = '';
	$url = sprintf($u, $w, $h, $s);
  	return $url;

$qr = qrCode('phpExample', 300, 300); // 300x300
<img src="<?= $qr ?>">

Result QR Code


There are no comments, make the firs comment