我正在使用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>Whit这块
$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>但是什么也没发生。有人能给我一些线索吗?
诚挚的问候
发布于 2011-02-16 20:48:52
尝试使用iframe元素的id:
$doc->find('#iFrame')->replaceWith('<p>test</p>');https://stackoverflow.com/questions/5016059
复制相似问题