我正在使用 PhpQuery,我需要为另一个标签替换“iframe”
html 文件有一个 iframe
<div id="content">
<div class="pad3"></div>
<iframe src="http://www.yahoo.com" id="iFrame"></iframe>
<div class="pad2"></div>
</div>
穿上这块
$doc = phpQuery::newDocumentFileHTML('file.htm');
$doc->find('iframe')->replaceWith('<p>test</p>');
我期待这个:
<div id="content">
<div class="pad3"></div>
<p>test</p>
<div class="pad2"></div>
</div>
但什么也没有发生。有人可以给我一些线索吗?
此致