PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How can I add text to an image?


There is a built in function to add text to an image. The tricky bit is knowing the parameters.

It is not worth learning these, therefore take note of them from an existing example or the manual each time that you need to write text with PHP!

The function used to do this using TrueType fonts is called imagettftext and take a deep breath as here come the parameters:

array imagettftext ( resource $image, float $size, float $angle, int $x, int $y, int $color, string $fontfile, string $text )

More images PHP Questions

How can I rotate an image?
How can I find the colour of a pixel of an image?
How can I find the width and height of an image resource?