Concatenate and write to a file in PHP questions

Hello to all,
I have two simple questions, but I’m new in PHP and don’t know exactly how to do it.
I’m converting a XML into an HTML file using PHP. Now the HTML file is show on the screen after runing the PHP script that parse the XML file. Instead of showing the HTML file on the screen I want to write it on a local file for later use. This file must be created on the fly, so it doesn’t exit localy. How can I do that? Should I use the fopen function or there is other better?

On the other hand, the HMTL file should have a name with the date and time, somethig like this:

namefile_20040824_111520.html
namefile_YYYYMMDD_HHMMSS.html
YYYY --> Year
MM -->moth
DD --> day
HH --> Hour
MM --> minutes
SS --> seconds

I know that in other languages there is a sentence to concatenate strings in order to name a file. Is there something similar in PHP?

Thanks to all.

you mean just giving it the extension .html ? no need for anything special doing that.

i think he means he wants to save the parsed xml file to another file. u gotta use fopen, fwrite then to write to the file for later use.

chris