1 2 3 4 5 6 7 8 9 10 11 12 13
| $drop_char_match = array('À','Á','Â','Ã','Ä','Å','à','á','â','ã','ä','å','Ò','Ó','Ô','Õ','Ö','Ø','ò','ó','ô','õ','ö','ø','È','É','Ê','Ë','è','é','ê','ë','Ç','ç','Ì','Í','Î','Ï','ì','í','î','ï','Ù','Ú','Û','Ü','ù','ú','û','ü','ÿ','Ñ','ñ','^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '-', '~', '+', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!');
$drop_char_replace = array('A','A','A','A','A','A','a','a','a','a','a','a','O','O','O','O','O','O','o','o','o','o','o','o','E','E','E','E','e','e','e','e','C','c','I','I','I','I','i','i','i','i','U','U','U','U','u','u','u','u','y','N','n',' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', '', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' , ' ', ' ', ' ', ' ', ' ', ' ');
$entry = ' ' . strip_tags(strtolower($entry)) . ' ';
$entry = preg_replace('/[\n\r]/is', ' ', $entry);
$entry = preg_replace('/\b&[a-z]+;\b/', ' ', $entry);
$entry = preg_replace('/\b[a-z0-9]+:\/\/[a-z0-9\.\-]+(\/[a-z0-9\?\.%_\-\+=&\/]+)?/', ' ', $entry);
for($i = 0; $i < count($drop_char_match); $i++)
{
$entry = str_replace($drop_char_match[$i], $drop_char_replace[$i], $entry);
}
$entry = str_replace('*', ' ', $entry);
$entry = preg_replace('/[ ]([\S]{1,2}|[\S]{3})[ ]/',' ', $entry);
$entry = preg_split("/[\s,]+/", $entry,-1, PREG_SPLIT_NO_EMPTY); |
Partager