It is extremely good practice to read a manual page before using some function. I myself always follow it, no exceptions.
Say, from one for file_put_contents you can learn 2 things:
$access
should be a filename.- to make it write many lines in a loop, special flag have to be used or file will be constantly overwritten with the last line
solved Error writing to a text file using fwrite and file_put_contents [closed]