一次代替fores in rss feed? [关闭]

This outputs all the images of the feed, but i just want to display the first one, what do i have to put in the tag instead of foreach?

        <?php foreach ($feed->get_items() as $item): ?>



        <?php $media_group = $item->get_item_tags('', 'enclosure');
        $file = $media_group[0]['attribs']['']['url'];
         ?>  



       <?php echo '

    <img width="200" src="' .$file. '"/>'; ?>

       <?php endforeach; ?>
<?php $items = $feed->get_items(); $item = $items [0]; ?>
<?php $media_group = $item->get_item_tags('', 'enclosure');
      $file = $media_group[0]['attribs']['']['url'];
?>  
<?php echo '<img width="200" src="' .$file. '"/>'; ?>