02-03-2009, 09:43 PM
|
#21 (permalink)
|
|
The Visitor
Join Date: Feb 2009
Posts: 2
Thanks: 0
|
Quote:
Originally Posted by tego10122
How would I cache it?
|
The imagejpeg function accepts an additional argument for a filename. If supplied, the image will be saved to disk.
To implement caching, do something like this:
Code:
if (file_exists('some_file.jpg'))
{
return true; // file exists, so display it
}
else
{
return false; // file does not exist, so generate it and save
}
|
|
|
|