Eli, the Computer Guy - Part 6


PHP Programming Part 6

Printing to Files with PHP


  1. In this example, you use the PHP file_put_contents() function. Briefly describe this function.

  2. file_put_contents(file, data._) is a function that will write the information you are giving to the file. The variable, $file, needs to set a value. In this case, it will be "file.csv". The function can also run several parameters.


  3. What is a CSV file? Why would you want to use one?

  4. CSV means Comma Separated Values and it is primarily used by Excel. An individual or a company may want to use this type of file in order to store data. It can also be easily opened with popular spreadsheet programs such as Excel, as mentioned earlier.


    The link to my working code is here.