History Clean Up
This commit is contained in:
38
class/Utilities.php
Normal file
38
class/Utilities.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Utilities
|
||||
{
|
||||
function cleanString($text) {
|
||||
$utf8 = array(
|
||||
'/[áàâãªä]/u' => 'a',
|
||||
'/[ÁÀÂÃÄ]/u' => 'A',
|
||||
'/[ÍÌÎÏ]/u' => 'I',
|
||||
'/[íìîï]/u' => 'i',
|
||||
'/[ěéèêë]/u' => 'e',
|
||||
'/[ĚÉÈÊË]/u' => 'E',
|
||||
'/[óòôõºö]/u' => 'o',
|
||||
'/[ÓÒÔÕÖ]/u' => 'O',
|
||||
'/[úùûü]/u' => 'u',
|
||||
'/[ÚÙÛÜ]/u' => 'U',
|
||||
'/Š/' => 'S',
|
||||
'/š/' => 's',
|
||||
'/Č/' => 'C',
|
||||
'/č/' => 'c',
|
||||
'/ř/' => 'r',
|
||||
'/Ř/' => 'R',
|
||||
'/Ý/' => 'Y',
|
||||
'/ý/' => 'y',
|
||||
'/ç/' => 'c',
|
||||
'/Ç/' => 'C',
|
||||
'/ñ/' => 'n',
|
||||
'/Ñ/' => 'N',
|
||||
'/–/' => '-', // UTF-8 hyphen to "normal" hyphen
|
||||
'/[’‘‹›‚]/u' => ' ', // Literally a single quote
|
||||
'/[“”«»„]/u' => ' ', // Double quote
|
||||
'/ /' => ' ', // nonbreaking space (equiv. to 0x160)
|
||||
);
|
||||
return preg_replace(array_keys($utf8), array_values($utf8), $text);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user