function get_chars(&$ret, $trainType, $char, $unicodeFrom, $unicodeTo) { try { $dic = new Dictionary(); $chars = $dic->get_chars($trainType, $char, $unicodeFrom, $unicodeTo); //初步获取候选字 if (isset($chars)) { $ret->res = $chars; $ret->msgno = MSG_OK; $ret->msg = MSG_OK_TXT; } else { $ret->msgno = MSG_ERR; $ret->msg = MSG_ERR_NOTFOUND; } } catch (Exception $e) { $ret->msgno = MSG_ERR; $ret->msg = $e->getMessage(); } //var_dump($ret); }