Horje
How to create Title to Image in PHP | PHP Image Tutorial Code
How to create Title to Image in PHP

Here is simplae example of Title to Image in PHP


Full Completed Code

index.php
Example: PHP
<?php
$title = 'Bangladesh is a Country';
$link = 'horje.com';
$cat = 'Blog Category';
$date = '05-Jan-2024';
$web = '[www.horje.com]';
$str1= $cat; 
$str2= $link;
$str3= $title;
$str4= $date;
$str5= $web;
?>
<?php
   
// Create the size of image or blank image
$image = imagecreate(350, 250);
   
// Set the background color of image
$background_color = imagecolorallocate($image,70,130,180);
   
// Set the text color of image
$text_color = imagecolorallocate($image, 255, 255, 255);

// Function to create image which contains string.
imagestring($image, 5, 45, 80, $str1, $text_color);
imagestring($image, 3, 45, 100, $str3, $text_color);
imagestring($image, 3, 45, 120, $str2, $text_color);
imagestring($image, 3, 45, 140, $str4, $text_color);
imagestring($image, 3, 45, 160, $str5, $text_color);



   
header("Content-Type: image/png");
   
imagepng($image);
imagedestroy($image);
?>

Output should be:

Full Completed Code



Read Full::
PHP Image Tutorial Code
Category:
PHP Tutorial Code
Sub Category:
PHP Image Tutorial Code
Uploaded:
3 months ago
Uploaded by:
Admin
Views:
95

Related Articles
How to create Title to Image in PHP PHP Image Tutorial Code

Single Articles
Full Completed Code

Share on: