如何将所有锚点替换为每个锚点文本。我的代码是
$body='<p>The man was <a href="http://www.example.com/video/">dancing like a little boy</a> while all kids were watching ... </p>';
i want the result to be :
<p>The man was dancing like a little boy while all kids were watching ... </p>
我使用了:
$body= preg_replace('#<a href="https?://(?:.+\.)?ok.co.*?>.*?</a>#i', '$1', $body);
并且结果是:
<p>The man was while all kids were watching ... </p>