Php is a server side scripting language... To do a image swap you would need to reload the page... wich is a really dump thing to do to just swap a image...
If you want to swap images, the best way to do it is through Jscript... there are some really good ones that are compatible even with V 3 browsers...
Or you could find many scripts (each for a specific browser) and use php to send the most appropriate acorrdind to the client browser version (from $HTTP_USER_AGENT)...
Hope it helps..