phpQuery ~ remove tag in html

此範例為使用phpQuery進去把該物件的img標籤取代掉

然後再取html出來


$feature = pq('blockquote:eq(0)');
foreach ($feature->find('img') as $img) {
$img = pq($img);
$img -> replaceWith('');
}
$feature = pq($feature) -> html();

沒有留言: