How do I encode a url string as a file name without loss of information, in PHP?

If /image.gif?random_code_which_renders_on-the-fly_images is a unique picture.

I want to save the image file content as random_code_which_renders_on-the-fly_images.gif

The problem is there is a huge loss in information the way Im doing it.
If /image.gif?random_code_which_renders _on-the-fly_images is a unique picture.

I want to save the image file content as random_code_which_renders _on-the-fly_images.gif

The problem is there is a huge loss in information the way Im doing it.
 
Back
Top