本文整理汇总了PHP中QRcode::encodeString方法的典型用法代码示例。如果您正苦于以下问题:PHP QRcode::encodeString方法的具体用法?PHP QRcode::encodeString怎么用?PHP QRcode::encodeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QRcode
的用法示例。
在下文中一共展示了QRcode::encodeString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: encode
public function encode($intext, $outfile = false)
{
$code = new QRcode();
if ($this->eightbit) {
$code->encodeString8bit($intext, $this->version, $this->level);
} else {
$code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive);
}
QRtools::markTime('after_encode');
if ($outfile !== false) {
file_put_contents($outfile, join("\n", QRtools::binarize($code->data)));
} else {
return QRtools::binarize($code->data);
}
}
示例2: QRcode
<?php
include '../lib/full/qrlib.php';
// now the fun begins, we use code generating features of library
// outputs raw code table, but it is not 1 & 0, lib uses more descriptive
// context related bit markers
$codeContents = '12345ABCDE';
$version = 0;
// will be autodetected
$eccLevel = QR_ECLEVEL_L;
$encodingHint = QR_MODE_8;
$caseSensitive = false;
$code = new QRcode();
$code->encodeString($codeContents, $version, $eccLevel, $encodingHint, $caseSensitive);
echo '<pre>';
foreach ($code->data as $line) {
echo bin2hex($line);
echo '<br/>';
}
echo '</pre>';