最佳答案
$document = new \DomDocument('1.0','UTF-8');
$document->loadHTML($source);
$rootElement = $document->documentElement;
$unwantedTags = $rootElement->getElementsByTagName('a');
foreach($unwantedTags as $tag)
{
$tag->parentNode->removeChild($tag);
}