Data to File in php with examples

Easy examples to post data to a file in php. Easy way to create a text file.