How can PHP arrays and while loops be used to efficiently display and manage multiple event dates on a website?

To efficiently display and manage multiple event dates on a website using PHP arrays and while loops, you can store the event dates in an array and then iterate over the array using a while loop to display each date dynamically. This approach allows you to easily add, remove, or update event dates without having to manually modify the code for each date.

<?php
// Array of event dates
$eventDates = array("2022-01-15", "2022-02-20", "2022-03-25");

// Display event dates using a while loop
$i = 0;
while($i < count($eventDates)) {
    echo "Event Date: " . $eventDates[$i] . "<br>";
    $i++;
}
?>