function unicode_encode($str, $encoding = 'GBK', $prefix = '&#', $postfix = ';') {
$str = iconv($encoding, 'UCS-2', $str);
$arrstr = str_split($str, 2);
$unistr = '';
for($i = 0, $len = count($arrstr); $i < $len; $i++) {
$dec = bin2hex($arrstr[$i]);
$decarr=str_split($dec);
$dec=$decarr[2].$decarr[3].$decarr[0].$decarr[1];
$unistr .= $prefix . $dec . $postfix;
}
return $unistr;
}
$keywords_unistr = unicode_encode($_GPC["keywords"],'UTF-8','u','\\\\\\\\');
$condition.=" and content like '%".$keywords_unistr."%' ";