Hi guys, this would be my first post here as a new member .
Let me start what my purpose right away, I have this piece of code trying out the ImageJpeg() function.
<?php
// Create a blank image and add some text
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
// Set the content type header - in this case image/jpeg
header('Content-Type: image/jpeg');
// Output the image
imagejpeg($im);
// Free up memory
imagedestroy($im);
?>
The site that I got the code showned the supposed right output. But mine give me this output (see the attached image).
Why is that happening? Sorry I'm new in PHP and don't know what to do. Please help me out thank you in advance.