PHP Tutorial: It is simple to write data to a file through the use of 2 fuctions - fwrite() (file write) and fputs() (file put string), although fputs() is an alias to fwrite(). This tutorial will show you how.