diff options
Diffstat (limited to 'inc/common.php')
-rw-r--r-- | inc/common.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/inc/common.php b/inc/common.php index 8b21c0585..845ca3634 100644 --- a/inc/common.php +++ b/inc/common.php @@ -41,7 +41,16 @@ function hsc($string){ */ function ptln($string,$intend=0){ for($i=0; $i<$intend; $i++) print ' '; - print"$string\n"; + echo "$string\n"; +} + +/** + * strips control characters (<32) from the given string + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function stripctl($string){ + return preg_replace('/[\x00-\x1F]+/s','',$string); } /** |