require_once 'src/Google/autoload.php'; $client = new \Google_Client(); $client->setApplicationName('STEaM @ ZILL'); $client->setScopes([\Google_Service_Sheets::SPREADSHEETS]); $client->setAccessType('offline'); $client->setAuthConfig(__DIR__ . '/Google Drive WP access-bcb2019a5ce8.json'); $service = new Google_Service_Sheets($client); $spreadsheetId = "1MtP6vEMIJZyo6St5pevNVO4bbLIF5catglZXFLT_eqM"; $range = 'Formulierreacties 1!B2:B10'; $response = $service->spreadsheets_values->get($spreadsheetId, $range); $values = $response->getValues(); if (empty($values)) { print 'No data found.\n'; } else { foreach ($values as $row) { for ($i = 0; $i < sizeof($row); $i++) { echo $row[$i].'\n'; } } }