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($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++;
}
}
只加了一句,然后模板中 以
<?php echo $text; ?>
就可以输出了。