Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 8, 2019 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/f09d86a3cfc0b047ae50d5d2e4cd0274 to your computer and use it in GitHub Desktop.
Save parzibyte/f09d86a3cfc0b047ae50d5d2e4cd0274 to your computer and use it in GitHub Desktop.
<?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