Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function populate_csv( $entry, $form ) {
- //Headers info
- $headers = array('Nominee', 'Reason', 'Justification');
- //Build form data
- $data = array(
- 'Nominee' => rgar( $entry, '1' ),
- 'Reason' => rgar( $entry, '4' ),
- 'Justification' => rgar( $entry, '3' ),
- );
- //Open or Create CSV File
- $fh = fopen('Nominations.csv', 'w');
- //Create headers
- fputcsv($fh, $headers);
- //Populate the data
- fputcsv($fh,$data);
- //Close the file
- fclose($fh);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement