<?php
header('Content-type: image/jpeg');
//loading custom form
$font=realpath('arial.ttf');
//creating pointer from sample image which is being edited
$image=imagecreatefromjpeg("format.jpg");
//Adding color
$color=imagecolorallocate($image, 51, 51, 102);
$date=date('d F, Y');
//Adding date on image
imagettftext($image, 18, 0, 880, 188, $color,$font, $date);
//Adding name on image
$name="Sagar kokare";
imagettftext($image, 48, 0, 120, 520, $color,$font, $name);
//Saving edited image on server
imagejpeg($image,"$name.jpg");
// you can show this image in browser
// imagejpeg($image);
imagedestroy($image);
?>
Comments
Post a Comment