我从后端拉入一些文本,现在我试图删除它随附的锚标签。我正在使用strip_tags
,但无法弄清楚它为什么不起作用。使用PHP删除锚标签(目前使用strip_tags)
另外:我可以接受的替代品,如果这是不是最好的方法
我已经试过:
<?php
$downloadcategory = the_terms($post->ID, 'download_category', '');
$downloadcategory .= strip_tags($downloadcategory);
echo $downloadcategory;
?>
和
<?php
$downloadcategory = the_terms($post->ID, 'download_category', '');
echo strip_tags($downloadcategory);
?>
你想删除只是锚标记或所有的html标签 – jonju
我只是想锚不见了,但它是目前唯一的标签,所以要么工作! –