How can PHP be used to prevent browser caching of images?

Browser caching of images can be prevented by adding a unique query string to the image URL. This can be achieved by appending a timestamp or a random string to the image URL using PHP. By doing so, the browser will treat each request for the image as a unique URL, thus preventing caching.

<img src="image.jpg?<?php echo time(); ?>" alt="Image">