What are the best practices for replacing text with images in PHP code for graphical elements like buttons?

When replacing text with images in PHP code for graphical elements like buttons, it is best practice to use CSS to style the button with a background image. This allows for easy customization and ensures that the button remains accessible to users with screen readers or other assistive technologies.

<button class="image-button">Click me</button>
```

```css
.image-button {
    background-image: url('button-image.png');
    background-size: cover;
    width: 150px;
    height: 50px;
    border: none;
    cursor: pointer;
}