-
-
Save parzibyte/f09d86a3cfc0b047ae50d5d2e4cd0274 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Ejemplo 1 para generar códigos QR | |
* con PHP | |
* | |
* @author parzibyte | |
*/ | |
# Cargar autoload de Composer | |
require_once "vendor/autoload.php"; | |
# Indicar que usaremos el namespace de QRCode | |
use Endroid\QrCode\QrCode; | |
# El texto que pondremos | |
$texto = "Generando códigos QR con PHP desde parzibyte.me"; | |
$codigoQR = new QrCode($texto); | |
header('Content-Type: ' . $codigoQR->getContentType()); | |
echo $codigoQR->writeString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment