What are the best practices for referencing images in PHP to ensure portability and scalability of the application?

When referencing images in PHP, it is important to use relative paths instead of absolute paths to ensure portability and scalability of the application. This means that the image paths should be specified relative to the current file location, rather than a specific directory on the server. By using relative paths, the application can be easily moved to different servers or directories without breaking the image references.

<img src="images/image.jpg" alt="Image">