nexuslinkservices / html-tag-purifier
v1.0.0
2016-09-17 12:15 UTC
Requires
- php: >=5.6.2
Requires (Dev)
- phpunit/phpunit: 5.5.*
This package is not auto-updated.
Last update: 2024-09-14 19:25:48 UTC
README
从内容中移除特定的HTML标签。
安装
如果您使用Composer,可以通过运行以下命令添加此包:
composer require galiteintechnologies/html-tag-purifier
使用
<?php
use HtmlTagPurifier\HtmlTagFilter;
$htmlTagFilter = new HtmlTagFilter();
$content = "<p>Thanks for coming.</p><br/><p>I have a special plan for picnic</p>. <b>Super <i>Excited!!</i></b>";
$tags = array("i", "p");
$result = $htmlTagFilter->purify($content, $tags);
输出
Thanks for coming.<br/>I have a special plan for picnic. <b>Super Excited!!</b>
贡献
欢迎提交拉取请求。