September 15, 2012 5:51 am

Add text to images with PHP

In this tutorial i will show you how you can add text using GD Library here is a very simple code to do that.

Write Text on image

In this file we use an image and write some text when we run that code it will write text on that image where ever you want to add in the image X and Y coordinates required.

After running this code you will get image like this.

Author Huzoor Bux

I am Huzoor Bux from Karachi (Pakistan). I have been working as a PHP Developer from last 5+ years, and its my passion to learn new things and implement them as a practice. Basically I am a PHP developer but now days exploring more in HTML5, CSS and jQuery libraries.

Tutorial Categories:
  • samfingcul

    how can i replace the background image (gang.jpg) with a database images which will pick them randomly?
    i mean.. i want to replace gang.jpg with $random_images_from_a_path

    thank you

    • Huzoor Bux

      Replace name of image like this.

      $im = imagecreatefromjpeg($random_images_from_a_path);

  • Shahbaz Ahmed Bhatti

    i need some help in php can anybody help me please