Summary

PHP’s support for the GD library enables you to produce dynamic charts and navigation elements with relative ease.

In this hour, you learned how to use imagecreate() and imagepng() to create and output an image. You learned how to acquire color resources with imagecolorallocate() and to use color resources with imagefill() to fill areas with color. You also learned how to use line and shape functions to create outline and filled shapes. You learned how to use PHP’s support for the FreeType library to work with TrueType fonts and worked through an example that wrote text to an image. Finally, you worked through a bar chart example that brought some of these techniques together into a single script.

Our next hour is timely indeed. It discusses ...

Get Sams Teach Yourself PHP in 24 Hours, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.