Contact me:

Email

Return to Eli-PHP Tutorials

PHP Programming Part 2: PHP Syntax and Errors


1. In this example, you use the PHP file_put_contents() function. Briefly describe this function. Hint: Consult W3Schools or the PHP manual.
The file_put_contents() function writes the information given to a file. The first argument of the function is the filename, and the next argument is the contents to be written.
Ex: file_put_contents($filename, $contentsToWrite);


2. What is a CSV file? Why would you want to use one?
A CSV is a comma separated variable file, which is a common way to store spreadsheet information. A CSV is useful, because it can be opened with any spreadsheet program and can be saved as an excel file where it can be formatted or sorted more easily.
Here is a working example of Eli's PHP email request application that writes the submitted emails to file.html.