public function encodeString($string, $version, $level, $hint, $casesensitive) { if ($hint != QR_MODE_8 && $hint != QR_MODE_KANJI) { throw new Exception('bad hint'); return NULL; } $input = new wechat_qrcode_QRinput($version, $level); if ($input == NULL) { return NULL; } $ret = wechat_qrcode_QRsplit::splitStringToQRinput($string, $input, $hint, $casesensitive); if ($ret < 0) { return NULL; } return $this->encodeInput($input); }