PHP code example of noprotocol / google-spreadsheet
1. Go to this page and download the library: Download noprotocol/google-spreadsheet library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
noprotocol / google-spreadsheet example snippets
$client = new Google_Client();
$client->setScopes('https://spreadsheets.google.com/feeds'); // when using ouath, ask for permissions
// other client setup code ...
$service = new SpreadsheetService($client);
$file = $service->getFile($id);
foreach ($file['pages'] as $pageId) {
$page = $service->getPage($id, $pageId, array('parseHeaders' => true));
foreach ($page['rows'] as $row) {
// do stuff...
}
};