mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-25 03:57:54 +00:00
updated examples
This commit is contained in:
+4
-5
@@ -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 '<pre>'.$qrcode->output().'</pre>';
|
||||
|
||||
$qrcode->setData('otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=buildwars.net', $qrOptions);
|
||||
var_dump($qrcode->getRawData());
|
||||
echo '<pre>'.print_r($qrcode->getRawData(), true).'</pre>';
|
||||
|
||||
echo 'QRCode: '.round((microtime(true)-$starttime), 5).PHP_EOL;
|
||||
|
||||
Reference in New Issue
Block a user