function Split($str) { global $charset, $app_lang; if (empty($str) || !$this->use_split_search) { return false; } if ($app_lang == "zh-cn") { require_once LOCALE_PATH . "cn_split_word.php"; $sp = new CnSplitWord(); $result = $sp->SplitRMM($str); $sp->Clear(); if (!empty($result)) { $return = explode(" ", $result); foreach ($return as $key => $val) { if (empty($return[$key])) { unset($return[$key]); } } } } else { //$return = explode(" ", $str); $return = false; } return $return; }
function Split($str) { global $charset, $app_lang; if (empty($str) || !$this->use_split_search) { return false; } if (in_array($charset, array('gbk', 'gb2312'))) { require_once(APP_PATH."locale/zh-cn/cn_split_word.php"); $sp = new CnSplitWord(); $result = $sp->SplitRMM($str); $sp->Clear(); if (!empty($result)) { $return = explode(" ", $result); foreach($return as $key=>$val){ if(empty($return[$key])) unset($return[$key]); } } }else{ //$return = explode(" ", $str); $return = false; } return $return; }