PHP has built-in CSV handling functions
o Resource-based functions – need to use fopen() to get $handle
int fputcsv ( resource $handle , array $fields )
o Parses the array $fields into a comma-separated string
o Write the string to the end of the file denoted by $handle
• Strings automatically quoted if contain blanks or commas
• Includes newline at end of CSV string
o Returns number of bytes written
array fgetcsv ( resource $handle )
o Reads one line from $handle
o Parses CSV content and returns an array containing an element for
each value in the CSV string
o Advances the file pointer to next line for looping