What are some common pitfalls when trying to place an image next to text in PHP?

One common pitfall when trying to place an image next to text in PHP is not properly aligning the elements using HTML and CSS. To solve this issue, you can use CSS to set the display property of the image and text elements to inline-block or float them next to each other.

echo '<div style="display:inline-block;">';
echo '<img src="image.jpg" style="width:100px;height:100px;">';
echo '<p style="display:inline-block;">Text next to image</p>';
echo '</div>';