string.strip_tags

使用此过滤器等同于用 strip_tags函数处理所有的流数据。可以用两种格式接收参数:一种是和 strip_tags函数第二个参数相似的一个包含有标记列表的字符串,一种是一个包含有标记名的数组。

Warning

This feature has been DEPRECATED as of PHP 7.3.0. Relying on this feature is highly discouraged.

示例 #1 string.strip_tags

<?php
$fp = fopen('php://output', 'w');
stream_filter_append($fp, 'string.strip_tags', STREAM_FILTER_WRITE, "<b><i><u>");
fwrite($fp, "<b>bolded text</b> enlarged to a <h1>level 1 heading</h1>\n");
fclose($fp);
/* Outputs:  <b>bolded text</b> enlarged to a level 1 heading   */

$fp = fopen('php://output', 'w');
stream_filter_append($fp, 'string.strip_tags', STREAM_FILTER_WRITE, array('b','i','u'));
fwrite($fp, "<b>bolded text</b> enlarged to a <h1>level 1 heading</h1>\n");
fclose($fp);
/* Outputs:  <b>bolded text</b> enlarged to a level 1 heading   */
?>