Home Tutorial Php Phpgd Php gd hello world

 
 

Share on Google+Share on Google+
Php gd hello world
Posted on: October 30, 2009 at 12:00 AM
Advertisement
This tutorial is about the displaying the hello world in PHP GD Library.

<?php

ini_set("display_errors", "1");

error_reporting(E_ALL);

header('content-type: image/png');

$image = imagecreatetruecolor(300, 300);

$dark_grey = imagecolorallocate($image, 102, 102, 102);

$white = imagecolorallocate($image, 255, 255, 255);

$font_path = 'C:/WINNT/Fonts/arial.ttf';

$string = 'Hello World!';

imagettftext ($image, 30, 0, 10, 130, $white, $font_path, $string);

imagegif($image);

imagedestroy($image);

?>

After running the program you will get the following output

Advertisement

Related Tags for Php gd hello world:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: October 30, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com