Skip to content

Instantly share code, notes, and snippets.

@DZuz14
Created August 4, 2017 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DZuz14/9d35388e5704ee2c7286e32bc7a0f753 to your computer and use it in GitHub Desktop.
Save DZuz14/9d35388e5704ee2c7286e32bc7a0f753 to your computer and use it in GitHub Desktop.
Accessing the Google Sheets API
<?php
// Insert into the sheet
$options = array('valueInputOption' => 'RAW');
$values = [
["$email","$first_name","$last_name","$zip_code"]
];
$body = new Google_Service_Sheets_ValueRange(['values' => $values]);
$result = $service->spreadsheets_values->append(SHEET_ID, 'A1:D', $body, $options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment