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

Method splitString

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

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

()

Source from the content-addressed store, hash-verified

2183
2184 //----------------------------------------------------------------------
2185 public function splitString()
2186 {
2187 while (strlen($this->dataStr) > 0)
2188 {
2189 if($this->dataStr == '')
2190 return 0;
2191
2192 $mode = $this->identifyMode(0);
2193
2194 switch ($mode) {
2195 case QR_MODE_NUM: $length = $this->eatNum(); break;
2196 case QR_MODE_AN: $length = $this->eatAn(); break;
2197 case QR_MODE_KANJI:
2198 if ($hint == QR_MODE_KANJI)
2199 $length = $this->eatKanji();
2200 else $length = $this->eat8();
2201 break;
2202 default: $length = $this->eat8(); break;
2203
2204 }
2205
2206 if($length == 0) return 0;
2207 if($length < 0) return -1;
2208
2209 $this->dataStr = substr($this->dataStr, $length);
2210 }
2211 }
2212
2213 //----------------------------------------------------------------------
2214 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