![qr code with text qr code with text](https://media.qrtiger.com/blog/2020/09/dimension_2_800.jpeg)
With the code and image in place, let's generate the new version of the QR code and see what it looks like. If you choose to use a different image, make sure that you save the image in public/img and pass the image's path as the second argument to $qrOutputInterface->dump().
![qr code with text qr code with text](https://thumbs.dreamstime.com/z/modern-qr-code-black-white-background-text-inside-121947278.jpg)
To download it, first open it in Twilio's Library, then click the " Actual size_PNG" link on the lower right-hand side of the page. For the purposes of this article, I'm using Twilio's logo. The last thing we need to do before testing the changes is to choose the image that we're going to overlay on the QR code. The code finishes up by calling $qrOutputInterface's dump method to overlay the image over the QR code and return a Base64-encoded string representation of the QR code.
#QR CODE WITH TEXT HOW TO#
$options and a new QRMatrix object are passed to QRImageWithLogo's constructor, so that it knows how to generate the QR code and the data to store in it. We've also set eccLevel to ECC_H to allow us to overlay a logo on the QR code, and set version to 7 to allow for a higher level of error correction, required because of the increased level of data in the QR code.Īfter that, we initialize $qrOutputInterface as a new QRImageWithLogo instance, which handles generating a QR code and overlaying the specified image on it using PHP's GD extension.
![qr code with text qr code with text](https://f5s3r6h9.rocketcdn.me/wp-content/uploads/2020/04/qr-code-home-768x768.gif)
The higher the value, the higher the QR code's quality. scale: This sets the size of a QR code pixel.I've set it to true, as it makes rendering the QR code simpler. imageBase64: This determines if the QR code will be rendered as binary data or a Base64-encoded string.In addition to these two, this code sets two others: