LoginSignup
0
2

More than 3 years have passed since last update.

【PHP】Google Sheet APIで、対象のスプレッドシートの特定範囲の最終行を取得する

Posted at

GASだと簡単にできるけども、SheetAPIだとすんなり取れなかったのでメモ

spreadsheetTest.php
// $this->spreadsheetIdにて特定したスプレッドシートのシート1のA3からI列までの範囲で、入力のある部分を情報として取得
$rowsInfo = $this->service->spreadsheets_values->get($this->spreadsheetId, 'シート1!A3:I');
// 上記のカウントが最終行になるが、項目などを指定している場合は以下の$lastRowに項目分の行をプラスする必要がある
$lastRow = count($row) + 2;
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2