(.*?)$tag>|s"; preg_match_all($preg, $string, $tags); foreach ($tags[1] as $tmpcont){ $tmpval[] = $tmpcont; } return $tmpval; } $items = untag2($xml, 'item'); $html = '
';
$i=0;
foreach ($items as $item) {
if ($i < $set){
$title = untag2($item, 'title');
$link = untag2($item, 'link');
$html .= '
\n";
$i++;
}
}
$html .= '