如何删除链接并保留文本?
text text text. <br><a href='http://www.example.com' target='_blank' title='title' style='text-decoration:none;'>name</a>
Run Code Online (Sandbox Code Playgroud)
像这样:
text text text. <br>
Run Code Online (Sandbox Code Playgroud)
我还有问题.....
$text = file_get_contents('http://www.example.com/file.php?id=name');
echo preg_replace('#<a.*?>.*?</a>#i', '', $text)
Run Code Online (Sandbox Code Playgroud)
在那个网址是那个文本(带链接)......
这段代码不起作用......
怎么了?
有人能帮我吗?