BETA

Try Posting Your Questions in Public Communities

Yasya El Hakim ·
Answered
· 3 Comments · 2 Replies · 59 Views

Have a question and need a quick answer? Try Posting Your Questions in Public Communities.

PS: This is just example of Thread 

Recommended Answer
Recommended Answer
·

How about this

require_once 'vendor/autoload.php';

$spreadsheetId = 'YOUR_SPREADSHEET_ID';
$sheetName = 'Sheet1';

$client = new Google_Client();
$client->setAuthConfig(json_decode(file_get_contents('key.json')));
$service = new Google_Service_Sheets($client);

$range = $sheetName . '!A1:C10';
$response = $service->spreadsheets_values->get($spreadsheetId, $range);

$data = $response->getValues();

// Menampilkan data
echo '<table>';
foreach ($data as $row) {
  echo '<tr>';
  foreach ($row as $cell) {
    echo '<td>' . $cell . '</td>';
  }
  echo '</tr>';
}
echo '</table>';
Tags: Thread
3 Comments
Recommended Answer
Recommended Answer
·

How about this

require_once 'vendor/autoload.php';

$spreadsheetId = 'YOUR_SPREADSHEET_ID';
$sheetName = 'Sheet1';

$client = new Google_Client();
$client->setAuthConfig(json_decode(file_get_contents('key.json')));
$service = new Google_Service_Sheets($client);

$range = $sheetName . '!A1:C10';
$response = $service->spreadsheets_values->get($spreadsheetId, $range);

$data = $response->getValues();

// Menampilkan data
echo '<table>';
foreach ($data as $row) {
  echo '<tr>';
  foreach ($row as $cell) {
    echo '<td>' . $cell . '</td>';
  }
  echo '</tr>';
}
echo '</table>';
Yasya El Hakim · Original Poster

Nice

Null

Yasya El Hakim · Original Poster

This is Test Comment

Yasya El Hakim · Original Poster

Test Reply

Share