3

readarg

readarg
SYNOPSIS

readarg($s, $trim=true, $strip=true)

DESCRIPTION
CODE
  1. function readarg($s, $trim=true, $strip=true) {
  2.     if (is_array($s)) {
  3.         return array_map('readarg', $s, array_fill(0, count($s), $trim), array_fill(0, count($s), $strip));
  4.     }
  5.  
  6.     if (get_magic_quotes_gpc()) {
  7.         $s = stripslashes($s);
  8.     }
  9.  
  10.     if ($trim) {
  11.         $s = trim($s);
  12.     }
  13.  
  14.     if ($strip) {
  15.         $s = strip_tags($s);
  16.     }
  17.  
  18.     return $s;
  19. }

Comments

To add a comment, click here.