Ejemplo n.º 1
0
 public function encode($intext, $outfile = false)
 {
     $code = new wechat_qrcode_QRcode();
     if ($this->eightbit) {
         $code->encodeString8bit($intext, $this->version, $this->level);
     } else {
         $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive);
     }
     wechat_qrcode_QRtools::markTime('after_encode');
     if ($outfile !== false) {
         file_put_contents($outfile, join("\n", wechat_qrcode_QRtools::binarize($code->data)));
     } else {
         return wechat_qrcode_QRtools::binarize($code->data);
     }
 }