Share on Google+Share on Google+

Php gd hello world

This tutorial is about the displaying the hello world in PHP GD Library.


ini_set("display_errors", "1");


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);




After running the program you will get the following output


Posted on: October 30, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial 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.