How can you modify the PHP script to only display a specific item from an XML RSS feed?

To display a specific item from an XML RSS feed in a PHP script, you can use SimpleXML to parse the XML feed and then access the specific item you want by its index. You can loop through the items in the feed and display the one that matches your criteria.

<?php
$rss = simplexml_load_file('https://example.com/feed.xml');

foreach ($rss->channel->item as $item) {
    if ($item->title == 'Specific Item Title') {
        echo '<h2>' . $item->title . '</h2>';
        echo '<p>' . $item->description . '</p>';
        break;
    }
}
?>