What are the potential issues with mixing processing and output logic in PHP code?

Mixing processing and output logic in PHP code can lead to code that is difficult to maintain and debug. It violates the principle of separation of concerns, making it harder to make changes to the processing logic without affecting the output. To solve this issue, it's recommended to separate the processing logic from the output logic by using PHP templates or a MVC (Model-View-Controller) architecture.

```php
// Processing logic
$data = fetchDataFromDatabase();

// Output logic
include 'template.php';
```

In this example, the processing logic is separated from the output logic by fetching data from the database first and then including a separate template file for displaying the data.