26 return htmlspecialchars($string, ENT_QUOTES, $char_set);
29 return htmlentities($string, ENT_QUOTES, $char_set);
32 return rawurlencode($string);
35 return str_replace(
'%2F',
'/',rawurlencode($string));
39 return preg_replace(
"%(?<!\\\\)'%",
"\\'", $string);
44 for ($x=0; $x < strlen($string); $x++) {
45 $return .=
'%' . bin2hex($string[$x]);
51 for ($x=0; $x < strlen($string); $x++) {
52 $return .=
'&#x' . bin2hex($string[$x]) .
';';
58 for ($x=0; $x < strlen($string); $x++) {
59 $return .=
'&#' . ord($string[$x]) .
';';
65 return strtr($string, array(
'\\'=>
'\\\\',
"'"=>
"\\'",
'"'=>
'\\"',
"\r"=>
'\\r',
"\n"=>
'\\n',
'</'=>
'<\/'));
69 return str_replace(array(
'@',
'.'),array(
' [AT] ',
' [DOT] '), $string);
74 for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) {
75 $_ord = ord(substr($string, $_i, 1));
78 $_res .=
'&#' . $_ord .
';';
81 $_res .= substr($string, $_i, 1);