class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
I think that the class is not really the good tool for that. You could probably use the watermark feature of the class to achieve your goal, calling process() 4 times. But you will loose some quality each time.
I want to merge 4 image file like this http://img543.imageshack.us/img543/1565/55055879.gif.
I need some margins between images and save as png transparent format, How can I do this ?
Thank you for any reply.
You should use Imagemagick. See for instance this page.
I have done, here is solution for photo merge