How to make a single picture (PNG/JPG) from a know number of pictures on PHP?

i have an array in php who contains pictures url (jpg pics). When you execute the php script this array is filled with url of pictures (for this example lets say 4 pics). At this point i want to equally distribute the pics in the space and generate a single one, like:
yhXDZ.png
 
Back
Top