-3

可能重复:
去除所有 HTML 标签,允许的除外

我是 PHP 新手

这是我的代码

<p>The filetype you are attempting to upload is not allowed.</p>

预期输出:

The filetype you are attempting to upload is not allowed.

如何删除标签<p>

4

4 回答 4

3

用于strip_tags()删除 HTML 标签

http://php.net/manual/en/function.strip-tags.php

echo strip_tags("<p>The filetype you are attempting to upload is not allowed.</p>");

会给你The filetype you are attempting to upload is not allowed.

于 2012-11-01T06:06:14.053 回答
1

用于strip_tags()从字符串中去除 html 标签

例子

$strip = '<p>The filetype you are attempting to upload is not allowed.</p>';
echo strip_tags($strip);

参考

于 2012-11-01T06:06:02.603 回答
1
$string= '<p>The filetype you are attempting to upload is not allowed.</p>';
$new_string = strip_tags($string);
于 2012-11-01T06:07:03.347 回答
0
$str= '<p>The filetype you are attempting to upload is not allowed.</p>';
$new_string = strip_tags($str);
于 2012-11-01T06:28:54.307 回答