this is nothing to do with php, more with dhtml
in the image tag, you put an ID attribute and name the tag
<IMG SRC="image1.jpg" ID="myimage">
then you have links with javascript in
<A HREF="" ONCLICK="myimage.src=image2.jpg">Click here</A>
you can even have non-link elements, such as pictures (including the picture you are changing) have the onclick attribute.
<IMG SRC="image1.jpg" ONCLICK="this.src=image2.jpg">
or you can use ONMOUSEOVER and ONMOUSEOUT to create rollover effects
<IMG SRC="image1.jpg" ONMOUSEOVER="this.src=image2.jpg" ONMOUSEOUT="this.src=image1.jpg">
this last example shows image1 normally, then image2 when the mouse is over it, then back to image1 when the mouse moves away.
hope this helps
adam