1 回答

TA貢獻(xiàn)1878條經(jīng)驗(yàn) 獲得超4個(gè)贊
這是我的解決方案:
if($xmlData->body){
$xmlIterator = new SimpleXMLIterator($xmlData->body->asXML());
$xmlIterator->rewind();
$txtBody = "";
for($i=0; $i < ($xmlIterator->count()); $i++){
$txtBody .= (trim($xmlIterator->current()) <> '') ? "<p>".trim($xmlIterator->current())."</p>" : "";
$xmlIterator->next();
}
#INSERT PULLQUOTE
foreach($xmlData->pullquote as $pull){
$txtBody .= $pull;
foreach ($pull->children() as $child){
$txtBody .= $child;
}
}
$data = $txtBody;
}
- 1 回答
- 0 關(guān)注
- 129 瀏覽
添加回答
舉報(bào)