In this PHP tutorial we know about how to add border to the images in the PHP GD Library.
In this PHP tutorial we know about how to add border to the images in the PHP GD Library.<?php
$im = imagecreate(200, 60);
$bg = imagecolorallocate($im, 225, 225, 225);
$textcolor = imagecolorallocate($im, 0, 0, 255);
imagestring($im, 5, 30, 20, "Roseindia", $textcolor);
$bordercolors = imagecolorallocate($im, 255, 255, 20); //Define border color Yellow
$x = 0;
$y = 0;
$w = imagesx($im) - 1;
$h = imagesy($im) - 1;
imageline($im, $x,$y,$x,$y+$h,$bordercolors);
imageline($im, $x,$y,$x+$w,$y,$bordercolors);
imageline($im, $x+$w,$y,$x+$w,$y+$h,$bordercolors);
imageline($im, $x,$y+$h,$x+$w,$y+$h,$bordercolors);
header("Content-type: image/png");
imagepng($im);
?>
After running the program you will get the following output