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

Method splitString

text-to-qr/lib/phpqrcode/qrsplit.php:248–274  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

246
247 //----------------------------------------------------------------------
248 public function splitString()
249 {
250 while (strlen($this->dataStr) > 0)
251 {
252 if($this->dataStr == '')
253 return 0;
254
255 $mode = $this->identifyMode(0);
256
257 switch ($mode) {
258 case QR_MODE_NUM: $length = $this->eatNum(); break;
259 case QR_MODE_AN: $length = $this->eatAn(); break;
260 case QR_MODE_KANJI:
261 if ($hint == QR_MODE_KANJI)
262 $length = $this->eatKanji();
263 else $length = $this->eat8();
264 break;
265 default: $length = $this->eat8(); break;
266
267 }
268
269 if($length == 0) return 0;
270 if($length < 0) return -1;
271
272 $this->dataStr = substr($this->dataStr, $length);
273 }
274 }
275
276 //----------------------------------------------------------------------
277 public function toUpper()

Callers 1

splitStringToQRinputMethod · 0.45

Calls 5

identifyModeMethod · 0.95
eatNumMethod · 0.95
eatAnMethod · 0.95
eatKanjiMethod · 0.95
eat8Method · 0.95

Tested by

no test coverage detected