53 $string = htmlentities($string, ENT_QUOTES,
'UTF-8');
55 return htmlspecialchars_decode($string);
66 $string = trim($string);
67 $string = stripslashes($string);
68 $string = convertToHtml($string);
70 $string = str_replace (
'€',
'€', $string);
71 $string = str_replace (
'&',
'&', $string);
72 $string = str_replace (
'\'',
''', $string);
73 $string = preg_replace(
"/:/",
":", $string);
77 $string = str_replace(
"<",
"<", $string);
78 $string = str_replace(
">",
">", $string);
92 $string = trim($string);
93 $string = stripslashes($string);
94 $string = convertToHtml($string);
96 $string = str_replace (
'€',
'€', $string);
97 $string = str_replace (
'•',
'•', $string);
98 $string = htmlentities($string, ENT_QUOTES,
'UTF-8');
100 $string = nl2br($string);
113 $string = trim($string);
114 $string = stripslashes($string);
115 $string = convertToHtml($string);
118 $string = preg_replace(
"#(\n*)#",
"", $string);
119 $string = preg_replace(
"#<!--(.*)-->#",
"", $string);
123 $string = str_replace (
'€',
'€', $string);
124 $string = str_replace (
'•',
'•', $string);
131 $string = htmlentities($string, ENT_QUOTES,
'UTF-8');
133 $string = preg_replace(
'#<([a-zA-Z]+)>#',
"<$1>", $string);
134 $string = preg_replace(
'#</([a-zA-Z]+)>#',
"</$1>", $string);
136 $string = preg_replace(
"#<([a-zA-Z]+)[\s]+[\w]*/>#",
"<$1 />", $string);
137 $string = preg_replace(
"#<([a-zA-Z]+)[\s]+(id|class|lang)="[\w\.\-]*"[\s]*>#",
"<$1>", $string);
140 $string = preg_replace(
"#><br />#",
">\n<br />", $string);
141 $string = preg_replace(
"#<br />\n(<[a-zA-Z]+>)#",
"$1\n<br />", $string);
162 $txt = replaceChar($str);
163 $txt = htmlentities($txt, ENT_QUOTES,
'UTF-8');
164 $txt = str_replace(
'€', chr(128), $txt);
165 $txt = html_entity_decode($txt);
180 $str = str_replace(chr(ord(
"`")),
"'", $str);
181 $str = str_replace(chr(ord(
"´")),
"'", $str);
182 $str = str_replace(chr(ord(
"„")),
",", $str);
183 $str = str_replace(chr(ord(
"`")),
"'", $str);
184 $str = str_replace(chr(ord(
"´")),
"'", $str);
185 $str = str_replace(chr(ord(
"“")),
"\"", $str);
186 $str = str_replace(chr(ord(
"”")),
"\"", $str);
187 $str = str_replace(chr(ord(
"´")),
"'", $str);
189 $unwanted_array = array(
'Š'=>
'S',
'š'=>
's',
'Ž'=>
'Z',
'ž'=>
'z',
'À'=>
'A',
'Á'=>
'A',
'Â'=>
'A',
'Ã'=>
'A',
'Ä'=>
'A',
'Å'=>
'A',
'Æ'=>
'A',
'Ç'=>
'C',
'È'=>
'E',
'É'=>
'E',
'Ê'=>
'E',
'Ë'=>
'E',
'Ì'=>
'I',
'Í'=>
'I',
'Î'=>
'I',
'Ï'=>
'I',
'Ñ'=>
'N',
'Ò'=>
'O',
'Ó'=>
'O',
'Ô'=>
'O',
'Õ'=>
'O',
'Ö'=>
'O',
'Ø'=>
'O',
'Ù'=>
'U',
'Ú'=>
'U',
'Û'=>
'U',
'Ü'=>
'U',
'Ý'=>
'Y',
'Þ'=>
'B',
'ß'=>
'Ss',
'à'=>
'a',
'á'=>
'a',
'â'=>
'a',
'ã'=>
'a',
'ä'=>
'a',
'å'=>
'a',
'æ'=>
'a',
'ç'=>
'c',
'è'=>
'e',
'é'=>
'e',
'ê'=>
'e',
'ë'=>
'e',
'ì'=>
'i',
'í'=>
'i',
'î'=>
'i',
'ï'=>
'i',
'ð'=>
'o',
'ñ'=>
'n',
'ò'=>
'o',
'ó'=>
'o',
'ô'=>
'o',
'õ'=>
'o',
'ö'=>
'o',
'ø'=>
'o',
'ù'=>
'u',
'ú'=>
'u',
'û'=>
'u',
'ý'=>
'y',
'ý'=>
'y',
'þ'=>
'b',
'ÿ'=>
'y');
191 $str = strtr($str, $unwanted_array);
193 # Bullets, dashes, and trademarks
194 $str = str_replace(chr(149),
"•", $str); # bullet •
195 $str = str_replace(chr(150),
"–", $str); # en dash
196 $str = str_replace(chr(151),
"—", $str); # em dash
197 $str = str_replace(chr(153),
"™", $str); # trademark
198 $str = str_replace(chr(169),
"©", $str); # copyright mark
199 $str = str_replace(chr(174),
"®", $str); # registration mark
207 $caracteres = get_html_translation_table(HTML_ENTITIES);
209 $remover = get_html_translation_table(HTML_SPECIALCHARS);
211 $caracteres = array_diff($caracteres, $remover);
213 $str = strtr($str, $caracteres);
216 $str = preg_replace(
"/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/",
"&" , $str);
223 $res = htmlentities($string);
224 $res = str_replace(
"<",
"<",$res);
225 $res = str_replace(
">",
">",$res);
226 $res = str_replace(
""",
'"',$res);
227 $res = str_replace(
"&",
'&',$res);