but if you want it to actually be in the image, you need the gd library.
http://us2.php.net/manual/en/ref.image.php
You could open the image, write the text, and then output the result.
It would look similar to how Mark suggests, but modifes the image, instead of the appearence.