What are the potential pitfalls of not specifying the height or width of images in PHP?
Not specifying the height or width of images in PHP can lead to distorted or stretched images when displayed on a webpage. To avoid this issue, it is important to set the height and width attributes of the image tag in HTML to ensure that the image is displayed at the correct dimensions.
// Example of setting height and width attributes for an image in PHP
echo '<img src="image.jpg" height="200" width="300" alt="Image">';