function wmloutput() { global $sid, $charset, $wapcharset; static $chs; $content = preg_replace("/\\<a(\\s*[^\\>]+\\s*)href\\=([\"|\\']?)([^\"\\'\\s]+)/ies", "transsid('\\3','<a\\1href=\\2',1)", ob_get_contents()); ob_end_clean(); if ($charset != 'utf-8') { $target = $wapcharset == 1 ? 'UTF-8' : 'UNICODE'; if (empty($chs)) { $chs = new Chinese($charset, $target); } else { $chs->config['SourceLang'] = $chs->_lang($charset); $chs->config['TargetLang'] = $target; } echo $wapcharset == 1 ? $chs->Convert($content) : str_replace(array('&#x;', '�'), array('??', ''), $chs->Convert($content)); } else { echo $content; } }