The simplest way of writing to a file in php is using the file_put_contents function. This implicitly calls fopen, fwrite and fclose, as we know from e.g. c.
Writing to a file in c is surprisingly simple. Most of the steps in c can be found in most other languages as well. In c you open a file, write to it and clo...