What are the advantages and disadvantages of using CSS3 for animations in PHP?

Using CSS3 for animations in PHP can provide a more visually appealing and interactive user experience on a website. CSS3 animations are generally more lightweight and efficient compared to using JavaScript for animations. However, CSS3 animations may not be as flexible or customizable as JavaScript animations, and they may not work as well on older browsers that do not support CSS3 features.

// Example PHP code using CSS3 animations for a loading spinner

echo '<div class="loader"></div>';
```

CSS code for the loading spinner animation:

```css
.loader {
  border: 16px solid #f3f3f3;
  border-top: 16px solid #3498db;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}