What potential issues could arise when using a banner rotation script in PHP?

One potential issue that could arise when using a banner rotation script in PHP is that the banners may not rotate evenly or may not display at all due to caching issues. To solve this problem, you can add a cache-busting parameter to the banner URLs to force the browser to fetch the updated banner each time.

<?php
$bannerUrls = [
    'banner1.jpg',
    'banner2.jpg',
    'banner3.jpg'
];

$randomBanner = $bannerUrls[array_rand($bannerUrls)];

echo '<img src="' . $randomBanner . '?v=' . time() . '" alt="Banner">';
?>