How can PHP be used to extract specific data from an RSS feed and display it in an HTML table?

To extract specific data from an RSS feed and display it in an HTML table using PHP, you can use the SimpleXML extension to parse the XML feed and extract the necessary information. You can then loop through the feed items to display the desired data in an HTML table format.

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

echo '<table>';
echo '<tr><th>Title</th><th>Description</th><th>Date</th></tr>';

foreach ($xml->channel->item as $item) {
    echo '<tr>';
    echo '<td>' . $item->title . '</td>';
    echo '<td>' . $item->description . '</td>';
    echo '<td>' . date('Y-m-d', strtotime($item->pubDate)) . '</td>';
    echo '</tr>';
}

echo '</table>';
?>