我的代码:
$span = $doc->createElement('span');
$iframe = $doc->createElement('iframe');
$iframe->setAttribute('src', 'https://www.name.com/frame/aaa');
$newnode = $doc->createElement('div');
$newnode->setAttribute('class', 'h_class');
$newnode->appendChild($span);
$newnode->appendChild($iframe);
$span
已添加到html,但未添加$iframe
span,p,div和其他代码可以正常工作,但iframe代码不起作用