Write Cell Data Horizontally

| July 24, 2022 | 274 views | Snippets

PhpSpreadsheet (Excel Files)

// Set cell values for A1-D1
foreach (range('A', 'D') as $letter) {
    $sheet->setCellValue($letter . '1', $letter . '1');
}

Google Sheets API Client Library For PHP (Google Sheets)

$body = new Google_Service_Sheets_ValueRange([
    'values' => [['Hello A1', 'Hello B1', 'Hello C1', 'Hello D1']]
]);

$params = [
    'valueInputOption' => 'RAW'
];

$result = $service->spreadsheets_values->update($spreadsheetId, 'A1:D1', $body, $params);

You might be interested.

0 Comments

Leave a Reply

Your email address will not be published.