You'll need:
1* fopen: int fopen ( string filename, string mode [, int use_include_path])
3* fwrite : int fwrite ( int fp, string string [, int length])
1* fclose: bool fclose ( int fp)
More details are available in the manual under the section on Filesystem Functions
Cheers