<?php
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
header('Content-Type: image/jpeg');
imagejpeg($im);
imagedestroy($im);
?>
this code is displaying error-
The image"http://localhost/untitled.php" cannot be displayed because it contains errors.
I am actually trying to make an image editor using php and here I am just simply trying to create an image using php and upload it in on the server. my code is showing the error as stated above.
What is actually the problem I don't understand.