I am using GD library and I tried to add a html on image using php echo.
<?php
$image = imagecreatefrompng("grafika.png");
$black = imageColorAllocate($image, 255, 255, 255);
$font = 'arial.ttf';
$text = 4;
if($text == 4) {
echo '<div style="background-color: yellow; width: 100px; height: 100px;">some text here</div>';
}
imagettftext($image, 16, 0, 50, 100, $black, $font, $text);
header("Content-type: image/png");
imagepng($image);
?>
What am I doing wrong ? Is there a different way to do this ?