hi, i want to know how can i write an image to a word document that i am writing a string to it too. $str="hello world" $fp = fopen("test.doc", "w+"); fwrite($fp,$str); fclose($fp); PHP: is there a way to add an image to $str so i can write the image with the string to the doc file? thank you
.doc documents are binary, and you can't manipulate them that easily. There's however a HTML-a-like .doc version. Save it as such and then you'll be able to add images using HTML (<img src="xxx" />). There's a class on www.phpclasses.org ... take a look there.