Horje

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



Single Articles
Full Completed CodePHP Image Tutorial


Related Articles
How to check Image error or valid in PHP PHP Image Tutorial
How to create Title to Image in PHP PHP Image Tutorial
How to convert a image link to Base64 in PHP PHP Image Tutorial
How to convert all external image link from html string to base64 in PHP PHP Image Tutorial

Type:
Php
Category:
Web Tutorial
Sub Category:
PHP Image Tutorial
Uploaded by:
Admin



Share on: