O'Reilly logo

PHP Advanced for the World Wide Web: Visual QuickPro Guide by Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a Simple Image

For the first example in this chapter, you'll create a simple image: text on a colored background. To be able to do so, you will only need use of the GD, zlib, and either the JPEG or PNG libraries, depending upon which format you want to create. Most installations of PHP should not have difficulty with the following script.

Making images with PHP is straightforward: You begin the process, you paint your picture, then you send the image to the Web browser (the images in the first three sections of the chapter will be created in memory and sent to the Web browser; the images in the final section will be saved on the server). It all starts with the imagecreate() function, which takes the width and height of the image, in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required