PhpQuery and replaceWith, How to?
I'm using PhpQuery and I need to replace an "iframe" for another tag
The html file have an Iframe
<div id="content">
<div class="pad3"></div>
<iframe src="http://www.yahoo.com" id="iFrame"></iframe>
<div class="pad2"></div>
</div>
Whit this piece of
$doc = phpQuery::newDocumentFileHTML('file.htm');
$doc->find('iframe')->replaceWith('<p>test</p>');
I 开发者_如何学编程expected this:
<div id="content">
<div class="pad3"></div>
<p>test</p>
<div class="pad2"></div>
</div>
But nothing happens. Can someone give me some clues?
Best Regards
Try using the id of your iframe element:
$doc->find('#iFrame')->replaceWith('<p>test</p>');
精彩评论