foreach($dom->getElementsByTagName('head') as $head) {
foreach($head->childNodes as $node) {
if($node instanceof DOMComment) {
$node->replaceData(16,60,'test');
}
}
}
This code works, I just let you search how to get 'offset' and 'count' value for the replaceData method !