How can the background color be set to gray on top and yellow on the bottom in a rounded rectangle using PHP?

To set the background color to gray on top and yellow on the bottom in a rounded rectangle using PHP, you can create a gradient background using CSS and apply it to a div element with rounded corners. This can be achieved by setting the background property to a linear gradient that transitions from gray to yellow vertically.

echo '<div style="background: linear-gradient(to bottom, gray, yellow); border-radius: 10px; padding: 20px;">';
echo 'Content here';
echo '</div>';