What are the potential pitfalls of using inline styles in PHP code for formatting?

Using inline styles in PHP code for formatting can make the code harder to maintain and update, as the styling is mixed in with the logic. It also violates the separation of concerns principle, making it difficult for designers to work independently on the styling. To solve this issue, it is recommended to separate the styling from the PHP code by using external CSS files and classes to apply styles to elements.

// Incorrect usage of inline styles
echo "<div style='color: red; font-size: 16px;'>Hello, World!</div>";

// Correct way to separate styling from PHP code
echo "<div class='styled-element'>Hello, World!</div>";
```

In an external CSS file:
```css
.styled-element {
  color: red;
  font-size: 16px;
}