PHP替换未知单词



我有那个文本:

$text = 'Some text... <a href="http://foo.bar/***">Read More</a>';

我需要删除此:<a href="http://foo.bar/***">Read More</a>***是未知的单词。

只需使用strip_tags函数

<?php 
$text = 'Some text... <a href="http://foo.bar/***">Read More</a>';
$text =strip_tags($text);
?>

您可以轻松尝试此功能

<?php
str_replace(
  "The Unkown phrase  you want to remove  "   ,
  " The New Phrase eg.Space if you want to  " ,
  $yourText
);
?>

最新更新