I need to create images dynamically, i.e the text on the image will be dynamic. Is there any way to generate the images with dynamic text and save it? I have tried the following
<?php
header("Content-type: image/jpeg");
$imgPath = 'image.jpg';
$image = imagecreatefromjpeg($imgPath);
$color = imagecolorallocate($image, 255, 255, 255);
$string = "THIS TEXT IS DYNAMIC";
$fontSize = 3;
$x = 115;
$y = 185;
imagestring($image, $fontSize, $x, $y, $string, $color);
imagejpeg($image);
?>
but it shows me the image with the text, but it does not save the image with this text written on it. I need to save the image with the text written on it