要获取此信息,您应该使用Google_Service_Sheets->电子表格方法,包括如下所示的gridData:$sheets = new \Google_Service_Sheets($client); //callling sheet api with authorized client$spreadsheet = $sheets->spreadsheets->get($spreadsheetId,['includeGridData' => true]);我认为电子表格有1张纸可以显示正确的格式设置:$sheet = $spreadsheet->getSheets();$format = $sheet[0]['data'][0]['rowData']['values'][0]['effectiveFormat']['numberFormat]; //this is one of example from that object希望有帮助I'm reading values from Google Sheets using google-api-php-client and google-api-php-client-services libraries this way: $service = new \Google_Service_Sheets($this->calendarService->getClient()); $spreadsheetId = 'abhslJcKXjIqS8bAJ1lojekXuOk0WOSrdtVtJ2C512jQ'; $range = 'Sheet Name'; $response = $service->spreadsheets_values->get($spreadsheetId, $range); $values = $response->getValues(); // returns all cells as arrayHow can I get information on format of each cell? (eg. number, date, email etc.). 解决方案 You can get cell formatting also get textFormat (bold,strikethrough etc) Beside, you can search the object there are more specs related to each cell.Cell Documentation of google apiTo be able to get this you should use Google_Service_Sheets -> spreadsheets method by including gridData like below :$sheets = new \Google_Service_Sheets($client); //callling sheet api with authorized client$spreadsheet = $sheets->spreadsheets->get($spreadsheetId,['includeGridData' => true]);And i assume spreadsheet has 1 sheet to show you correct place of formatting :$sheet = $spreadsheet->getSheets();$format = $sheet[0]['data'][0]['rowData']['values'][0]['effectiveFormat']['numberFormat]; //this is one of example from that objectHope it helps 这篇关于使用PHP从Google表格中获取单元格格式信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!