简体   繁体   English

如何按特定类别从条形标签功能中排除

[英]how to exclude from strip tag function by specific class

i want to strip tag a string and exclude an a tag by specific class Name. 我想剥离标记字符串,并按特定的类名排除标记。

have this input : 有此输入:

<p><a class="className">Text</a></p>

want this output: 想要这个输出:

<a class="className">Text</a>
strip_tags(STRING, ALLOW TAG);

<?php
$text = '<p><a class="className">Text</a></p>';
echo strip_tags($text, "<a>");
?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM