1 回答
TA贡献1878条经验 获得超4个赞
这是我的解决方案:
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 关注
- 111 浏览
添加回答
举报