diff --git a/examples/custom.php b/examples/custom.php index 7d5f20520..be1f14383 100644 --- a/examples/custom.php +++ b/examples/custom.php @@ -15,15 +15,14 @@ $qrOptions->errorCorrectLevel = QRCode::ERROR_CORRECT_LEVEL_M; $qrStringOptions = new QRStringOptions; $qrStringOptions->type = QRCode::OUTPUT_STRING_TEXT; -$qrStringOptions->textDark = '+'; -$qrStringOptions->textLight = '-'; +$qrStringOptions->textDark = '#'; +$qrStringOptions->textLight = ' '; // google authenticator // https://chart.googleapis.com/chart?chs=200x200&chld=M%7C0&cht=qr&chl=otpauth%3A%2F%2Ftotp%2Ftest%3Fsecret%3DB3JX4VCVJDVNXNZ5%26issuer%3Dchillerlan.net $qrcode = new QRCode('otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net', new QRString($qrStringOptions), $qrOptions); -var_dump($qrcode->output()); +echo '
'.$qrcode->output().'
'; -$qrcode->setData('otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=buildwars.net', $qrOptions); -var_dump($qrcode->getRawData()); +echo '
'.print_r($qrcode->getRawData(), true).'
'; echo 'QRCode: '.round((microtime(true)-$starttime), 5).PHP_EOL; diff --git a/examples/image.php b/examples/image.php index addbaf0e4..0c94b64e0 100644 --- a/examples/image.php +++ b/examples/image.php @@ -4,16 +4,7 @@ require_once '../vendor/autoload.php'; use chillerlan\QRCode\Output\QRImage; use chillerlan\QRCode\QRCode; -use chillerlan\QRCode\QRConst; -use chillerlan\QRCode\QROptions; -$qrOptions = new QROptions; -$qrOptions->output = new QRImage(); +$im = (new QRCode('https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s', new QRImage))->output(); -$qr = new QRCode('https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s', $qrOptions); - -header('Content-type: image/png'); - -$im = $qr->output(); -imagepng($im); -imagedestroy($im); +echo '';