I have a function that creates an image using the GD library. I am naming each image using the time() function to create a unique image everytime so the browser will not cache the image. After I create the image, I echo it to the screen for the user to view. What I would like to do after echoing it is to unlink the image to remove it from the directory. I have tried adding the unlink command to the function after echoing the image, but then it shows the image as broken, since it gets deleted before being output to the browser. So my question is, how can I unlink the image immediately after it is displayed in the browser? I hope that all made sense. I'm fighting a cold and can't wrap my brain around this completely. TIA.