How can PHP arrays be used to store and process multiple RSS feed URLs?

To store and process multiple RSS feed URLs in PHP, you can use an array to hold the URLs and then loop through the array to fetch and process each feed individually. This allows for easier management and scalability when dealing with multiple feeds.

<?php
// Array of RSS feed URLs
$feedUrls = [
    'https://example.com/feed1.xml',
    'https://example.com/feed2.xml',
    'https://example.com/feed3.xml'
];

// Loop through each feed URL
foreach ($feedUrls as $url) {
    $rss = simplexml_load_file($url);
    
    // Process the RSS feed data as needed
    foreach ($rss->channel->item as $item) {
        echo $item->title . '<br>';
        echo $item->description . '<br>';
        echo $item->link . '<br>';
        echo '<br>';
    }
}
?>