'\\\\', "'" => "\\'", '"' => '\\"', "\r" => '\\r', "\n" => '\\n', ' '<\/')); } if ($esc_type == 'mail') { // safe way to display e-mail address on a web page return str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string); } if ($esc_type == 'nonstd') { // escape non-standard chars, such as ms document quotes $_res = ''; for ($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) { $_ord = ord(substr($string, $_i, 1)); // non-standard char, escape it if ($_ord >= 126) { $_res .= '&#' . $_ord . ';'; } else { $_res .= substr($string, $_i, 1); } } return $_res; } return $string; } ?>