- var_dump: documentation ( source)
- sprintf: documentation ( source)
<?php
$html = <<<HTML
<a name="file_type_definition"></a>file_type_definition ::=
<font color=#a08000><strong>FILE<span>other stuff</span></strong></font> <font color=#a08000><strong>OF</strong></font> <a href="#type_mark">type_mark</a>
HTML;
$dom = new DOMDocument();
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
foreach($xpath->query('//strong') as $strong) {
$strong->parentNode->replaceChild(new DOMText(sprintf("'%s'", $strong->textContent)),$strong);
}
var_dump($dom->textContent);