* @copyright 2017 Smiley * @license MIT */ namespace chillerlan\QRCodeExamples; use chillerlan\QRCode\{QRCode, QROptions}; use chillerlan\QRCode\Data\QRMatrix; use chillerlan\QRCode\Common\EccLevel; require_once __DIR__.'/../vendor/autoload.php'; $data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s'; $options = new QROptions([ 'version' => 5, 'outputType' => QRCode::OUTPUT_STRING_TEXT, 'eccLevel' => EccLevel::L, ]); //
to view it in a browser echo ''.(new QRCode($options))->render($data).''; // custom values $options = new QROptions([ 'version' => 5, 'outputType' => QRCode::OUTPUT_STRING_TEXT, 'eccLevel' => EccLevel::L, 'moduleValues' => [ // finder QRMatrix::M_FINDER | QRMatrix::IS_DARK => 'A', // dark (true) QRMatrix::M_FINDER => 'a', // light (false) QRMatrix::M_FINDER_DOT | QRMatrix::IS_DARK => 'รค', // finder dot, dark (true) // alignment QRMatrix::M_ALIGNMENT | QRMatrix::IS_DARK => 'B', QRMatrix::M_ALIGNMENT => 'b', // timing QRMatrix::M_TIMING | QRMatrix::IS_DARK => 'C', QRMatrix::M_TIMING => 'c', // format QRMatrix::M_FORMAT | QRMatrix::IS_DARK => 'D', QRMatrix::M_FORMAT => 'd', // version QRMatrix::M_VERSION | QRMatrix::IS_DARK => 'E', QRMatrix::M_VERSION => 'e', // data QRMatrix::M_DATA | QRMatrix::IS_DARK => 'F', QRMatrix::M_DATA => 'f', // darkmodule QRMatrix::M_DARKMODULE | QRMatrix::IS_DARK => 'G', // separator QRMatrix::M_SEPARATOR => 'h', // quietzone QRMatrix::M_QUIETZONE => 'i', ], ]); //to view it in a browser echo ''.(new QRCode($options))->render($data).'';