|
@@ -48,7 +48,7 @@ discard block |
|
|
block discarded – undo |
|
48
|
48
|
$string = strip_tags($string); |
|
49
|
49
|
$string = trim($string); |
|
50
|
50
|
$string = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $string); // Remove special alphanumeric characters |
|
51
|
|
- $string = str_replace(array('+', '=', '!', ',', '.',';', ':', '?'), ' ', $string); // Replace sentence breaking charaters with spaces |
|
|
51
|
+ $string = str_replace(array('+', '=', '!', ',', '.', ';', ':', '?'), ' ', $string); // Replace sentence breaking charaters with spaces |
|
52
|
52
|
$string = preg_replace("/[\r\n]+/", " ", $string); // Replace multiple newlines with a single space. |
|
53
|
53
|
$string = preg_replace("/[\t]+/", " ", $string); // Replace multiple tabs with a single space. |
|
54
|
54
|
$string = preg_replace("/[^a-zA-Z0-9 ]/", '', $string); // Filter out everything that is not alphanumeric or a space |
|
@@ -66,7 +66,7 @@ discard block |
|
|
block discarded – undo |
|
66
|
66
|
{ |
|
67
|
67
|
$encoding = mb_detect_encoding($string, mb_detect_order(), false); |
|
68
|
68
|
|
|
69
|
|
- if($encoding == "UTF-8") { |
|
|
69
|
+ if ($encoding == "UTF-8") { |
|
70
|
70
|
$string = mb_convert_encoding($string, 'UTF-8', 'UTF-8'); |
|
71
|
71
|
} |
|
72
|
72
|
|