code: protected static function stripslashesRecursive($var)
      {
          if (!is_array($var)) {
              return stripslashes(strval($var));
          }
  
          foreach ($var as $key => $val) {
              $var[$key] = (is_array($val)) ? self::stripslashesRecursive($val) : stripslashes(strval($val));
          }
  
          return $var;
      }
docs: Strips slashes from each element of an array using stripslashes().
  
  @param  mixed $var
  @return mixed