To save an image to disk with the imagepng/imagejpg/imagewbmp functions all
you have to do is give the file name as the second parameter to the
function; so if you wanted to call the first graph 'graph1.png', it would go
something like


$graph = imagecreate(320,240);

/* (Draw the graph here) */

imagepng($graph, 'graph1.png');


imagepng will attempt to save graph1.png in the same directory as the
script.  Where ever you tell it to save the image, make sure your web server
(if Apache - I don't know about IIS) has permission to write files to that


> -----Original Message-----
> From: Campano, Troy [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 24, 2002 12:40 PM
> Subject: [PHP] PHP to create static images
> I am doing some work with creating graphs using the GD library.
> Does anyone know how I can create the graphs statically so I can
> save the output as a GIF or PNG?
> I want to run a script that will take in say 10 datasets and then
> create 10 PNG images on the file server.
> Any ideas?
> thank you!
> Troy Campano

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to