I recommend you use LightBox or PrettyPhoto, or some other JQuery "slideshow".
Using JQuery is way better than any single PHP method. PHP will create the dynamic
Here's an example, click on any thumbnail:
That example uses PrettyPhoto, but there are several different JQuery scripts.
You could also use a Flash method, but Flash is not supported very well with iphone,
ipad, ipod ... at least not yet.