MCPcopy Create free account
hub / github.com/codemistic/Web-Development / encode

Method encode

text-to-qr/lib/phpqrcode/phpqrcode.php:3268–3285  ·  view source on GitHub ↗

----------------------------------------------------------------------

($intext, $outfile = false)

Source from the content-addressed store, hash-verified

3266
3267 //----------------------------------------------------------------------
3268 public function encode($intext, $outfile = false)
3269 {
3270 $code = new QRcode();
3271
3272 if($this->eightbit) {
3273 $code->encodeString8bit($intext, $this->version, $this->level);
3274 } else {
3275 $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive);
3276 }
3277
3278 QRtools::markTime('after_encode');
3279
3280 if ($outfile!== false) {
3281 file_put_contents($outfile, join("\n", QRtools::binarize($code->data)));
3282 } else {
3283 return QRtools::binarize($code->data);
3284 }
3285 }
3286
3287 //----------------------------------------------------------------------
3288 public function encodePNG($intext, $outfile = false,$saveandprint=false)

Callers 2

encodePNGMethod · 0.95
textMethod · 0.45

Calls 4

encodeString8bitMethod · 0.45
encodeStringMethod · 0.45
markTimeMethod · 0.45
binarizeMethod · 0.45

Tested by

no test coverage detected