VBScript strip_tags function

A VBScript equivalent of PHP’s strip_tags


Function strip_tags( str )

    Dim objRegExp
    Dim plane

    plane = Trim( str & " )

    If Len( plane ) > 0 Then

        Set objRegExp = New RegExp
        objRegExp.IgnoreCase = True
        objRegExp.Global = True
        objRegExp.Pattern= "]+>"
        plane = objRegExp.Replace(str, ")
        Set objRegExp = Nothing

    End If

    strip_tags = plane

End Function

Please also note that php.vbs offers community built functions and goes by the McDonald’s Theory. We’ll put online functions that are far from perfect, in the hopes to spark better contributions. Do you have one? Then please just:

Other PHP functions in the strings extension