What are some common mistakes to avoid when trying to specify image dimensions in PHP scripts?

One common mistake to avoid when specifying image dimensions in PHP scripts is not using the correct syntax for setting the width and height attributes. It's important to provide the dimensions in the correct order and format to ensure the image is displayed correctly on the webpage.

// Incorrect way of specifying image dimensions
echo '<img src="image.jpg" width="500px" height="300px">';

// Correct way of specifying image dimensions
echo '<img src="image.jpg" width="500" height="300">';