$string = strtolower($content);
$string = strip_tags($string);
$string = str_replace('.', '', $string);
$string = str_replace('>', '', $string);
$string = str_replace('!', '', $string);
$string = str_replace('?', '', $string);
$string = str_replace(',', '', $string);
$string = str_replace(':', '', $string);
$string = str_replace(';', '', $string);
$string = str_replace('-', '', $string);
$string = str_replace('"', '', $string);
$string = str_replace('(', '', $string);
$string = str_replace(')', '', $string);
$string = str_replace('@', '', $string);
$string = str_replace('\'', '', $string);
$string = str_replace('\\', '', $string);
$string = str_replace('\/', '', $string);
$string = str_replace('%', '', $string);
$string = str_replace('`', '', $string);
$string = str_replace('~', '', $string);
$string = str_replace('+', '', $string);
$string = str_replace('=', '', $string);
$string = str_replace('_', '', $string);
$string = str_replace('1', '', $string);
$string = str_replace('2', '', $string);
$string = str_replace('3', '', $string);
$string = str_replace('4', '', $string);
$string = str_replace('5', '', $string);
$string = str_replace('6', '', $string);
$string = str_replace('7', '', $string);
$string = str_replace('8', '', $string);
$string = str_replace('9', '', $string);
$string = str_replace('0', '', $string);
$string = str_replace('\n', '', $string);
$string = str_replace('\t', '', $string);
$string = str_replace('\b', '', $string);
$string = str_replace('\0', '', $string);
$string = str_replace('\x0B', '', $string);
$string = str_replace(' ', ' ', $string);
$keywords = explode(' ', &$string);
foreach ($keywords as $key=>$word)
{ if (strlen($word) > 2) // простейший фильтр стоп слов
{ $words[]=$word;
}
}