public static function trim_stripslashes_deep($value){
        if ( is_array($value) ) {
            $value = array_map(array(get_called_class(), 'trim_stripslashes_deep'), $value);
        } elseif ( is_object($value) ) {
            $vars = get_object_vars( $value );
            foreach ($vars as $key=>$data) {
                $value->{$key} = self::trim_stripslashes_deep( $data );
            }
        } elseif ( is_string( $value ) ) {
            $value = trim(stripslashes($value));
        }
        return $value;
    }