<?
function suGenerateSearch($search)
{
$toRemove = Array('.', ',', '!', '?', ':', ';', ')', '(', '"', '\'', "\n", "\r", "\t", ' ');
$search = str_replace($toRemove, ' ', $search); // replace special symbols
$search = unhtmlentities($search); // replace html-entities
$search = str_replace('>','> ', $search); // add space after tags
$search = strip_tags($search); // strip html tags
$search = preg_replace('/ {2,}/', ' ', $search); // replace more than one space to one space
$search = sqllike($search); // make case-insensetive and accent-insensetive string
//$search = $lower($search); // or make case-sensetive string
$search = convert($search, $GLOBALS['suLANG']['langs'][suLANG]['code'], 'su'); // convert to internal "su" encoding
$search = str_replace('Bx', ' ', $search); // replace space in "su" encoding to normal word delimiter
return $search;
}
?>