Yep, as far as the client software (NS, IE, ETC.) is concerned a php script is just a bunch of data, the server executes the script it then sends whatever the script tells it to send. So all you do is tell the client that it's a graphic and BAM it's a graphic, well not quite that simple you still need to get the graphic data from somewhere, but thats easily done with PHP's graphic functions.
Anyways here's a basic example of how to get a php script used in the palace of a graphic.
index.html
<img src="getimage.php">
getimage.php
header("Content-type: image/jpeg");
include("image.jpg");
Now I know I kinda cheated there I'm just obraining the data from the file "image.jpg" but for what I was trying to demonstrate it was a whole lot cleaner than trying to show all the createimage functions and junk, there are a whole bunch of tutorials out there, on here on phpbuilder as well, so I didn't think I should get too in depth here.
Anyways hope this helps at least in part.