You are here : phpstringstrip_tags

strip_tags() - string

This function tries to return a string with all NULL bytes, HTML and PHP tags stripped
   from a given str.  It uses the same tag stripping
   state machine as the fgetss() function.
Parameters :
  • str - The input string.
  • allowable_tags - You can use the optional second parameter to specify tags which should not be stripped. Note: HTML comments and PHP tags are also stripped. This is hardcoded and can not be changed with allowable_tags. Note: In PHP 5.3.4 and later, self-closing XHTML tags are ignored and only non-self-closing tags should be used in allowable_tags. For example, to allow both
    , you should use: ');?>

  • Syntax

    string strip_tags
        ( string $str
       [, string $allowable_tags
      ] )


    <?phpstrip_tags($input, '<br>');?>

    Output / Return Value


    Alternatives / See Also