Here is simplae example of Title to Image in 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);
?>
How to check Image error or valid in PHP | PHP Image Tutorial |
How to create Title to Image in PHP | PHP Image Tutorial |
Full Completed Code | PHP Image Tutorial |
Read Full:: | PHP Image Tutorial |
Category: | Web Tutorial |
Sub Category: | PHP Image Tutorial |
Uploaded: | 8 months ago |
Uploaded by: | Admin |
Views: | 174 |