foreach($dtp->CTags as $ctag)
{
if($ctag->GetName()=="img")
{
if($i==($npos-1)) $preSrc = trim($ctag->GetInnerText());
if($i==($npos+1)) $nextSrc = trim($ctag->GetInnerText());
$i++;
}
} 核心代码就在这里了,一个foreach循环,自然要修改这里了,修改后如下:
foreach($dtp->CTags as $ctag)
{
if($ctag->GetName()=="img")
{
if($i==($npos-1)) $preSrc = trim($ctag->GetInnerText());
if($i==($npos+1)) $nextSrc = trim($ctag->GetInnerText());
if($i==$npos) $text = $ctag->GetAtt('text');
$i++;
}
}
|
版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!