What potential issue could arise when setting the Content-Type header to 'image/jpeg' in PHP?

Setting the Content-Type header to 'image/jpeg' in PHP may result in the browser expecting an image file, but receiving text data instead, which could lead to display issues or errors. To solve this issue, you should ensure that you are outputting the image data correctly and not mixing it with any other content.

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

// Output the image data directly
$imageData = file_get_contents('path/to/image.jpg');
echo $imageData;
?>