What are common reasons for the issue of "Grafik ausgeben -> nur Zeichnesalat" when trying to output a PNG image in PHP?

The issue of "Grafik ausgeben -> nur Zeichnesalat" typically occurs when there is an encoding mismatch between the image data and the output method. To solve this issue, you can set the correct content type header before outputting the image data.

<?php
// Set the content type header to image/png
header('Content-Type: image/png');

// Output the PNG image data
echo file_get_contents('path/to/your/image.png');