php function utf8_htmlspecialchar string return htmlspecialchars strin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
function utf8_htmlspecialchars($string)
{
return htmlspecialchars($string, ENT_COMPAT, 'UTF-8');
}
function utf8_stripslashes($string)
{
return preg_replace(array('/\x5C(?!\x5C)/u', '/\x5C\x5C/u'), array('', '\\'), $string);
}
function utf8_strtoupper($string)
{
return mb_strtoupper($string);
}
function cp1251_to_utf8($string)
{
return mb_convert_encoding($string, 'UTF-8', 'CP1251');
}
function utf8_ucfirst($string)
{
return mb_strtoupper(mb_substr($string, 0, 1)) . mb_substr($string, 1);
}
?>