How can the browser cache affect the display of newly uploaded images in PHP?

When a new image is uploaded in PHP, the browser cache may still display the old version of the image instead of the newly uploaded one. This can be resolved by adding a cache-busting query parameter to the image URL, forcing the browser to fetch the new image instead of using the cached version.

<?php
$imageUrl = 'path/to/newly/uploaded/image.jpg';
$imageUrlWithCacheBuster = $imageUrl . '?t=' . time(); // Add timestamp as cache buster

echo '<img src="' . $imageUrlWithCacheBuster . '" alt="Newly Uploaded Image">';
?>