case 'urlpathinfo':
return str_replace('%2F','/',rawurlencode($string));
-
+
case 'quotes':
// escape unescaped single quotes
return preg_replace("%(?<!\\\\)'%", "\\'", $string);
$return .= '%' . bin2hex($string[$x]);
}
return $return;
-
+
+ case 'phone':
+ $return = str_replace('+','0',$string);
+ $return = preg_replace('/[^0-9]+/','',$return);
+ return $return;
+
case 'hexentity':
$return = '';
for ($x=0; $x < strlen($string); $x++) {
case 'javascript':
// escape quotes and backslashes, newlines, etc.
return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/'));
-
+
case 'mail':
// safe way to display e-mail address on a web page
return str_replace(array('@', '.'),array(' [AT] ', ' [DOT] '), $string);
-
+
case 'nonstd':
// escape non-standard chars, such as ms document quotes
$_res = '';