• Merge Cells

    Are you looking for merge cells snippets? Below are the different snippets you can use to merge cells with PhpSpreadsheet or Google Sheets API PHP Client. PhpSpreadsheet (Excel Files) // Merge cells from A1 to D5 $sheet->mergeCells(‘A1:D5’); Google Sheets API PHP Client $requests = [ new Google_Service_Sheets_Request([ ‘mergeCells’ => [ ‘range’ => [‘startRowIndex’=> 1, ‘endRowIndex’=> […]

    Read more


  • Write Cell Data Horizontally

    Are you looking for spreadsheet snippets to write cell data horizontally? Below are the different snippets you can use to write spreadsheet cell data horizontally with PhpSpreadsheet or Google Sheets API PHP Client. PhpSpreadsheet (Excel Files) // Set cell values for A1-D1 foreach (range(‘A’, ‘D’) as $letter) { $sheet->setCellValue($letter . ‘1’, $letter . ‘1’); } […]

    Read more


  • Write Google Sheets Data To A Single Range Horizontally Using Google Sheets API PHP Client

    Very similar with the Create A “Hello World” SpreadSheet Using Google Sheets API PHP Client tutorial that was previously published, we will be attempting to further demonstrate the ability of the Google Sheets API and its PHP Client Library to write to a single range of a given Google Sheet. This article will focus on […]

    Read more


  • Change A Spreadsheet Title

    Are you looking for snippets to change a spreadsheet title? Here are the different snippets you can use to change spreadsheet title with PhpSpreadsheet or Google Sheets API PHP Client. PhpSpreadsheet (Excel Files) // Set the properties or metadata of the file $spreadsheet->getProperties() ->setTitle(“Put The New Title Of The Spreadsheet Here”) ; Google Sheets API […]

    Read more


  • Change Google Spreadsheet Title Using Google Sheets API PHP Client

    Rename Google Spreadsheets using the method spreadsheets.batchUpdate with request UpdateSpreadsheetPropertiesRequest by assigning a new value to it’s title property. Having a clearly defined Google Spreadsheet title will help identify your speadsheets more quickly, thus leaving them more organized and easier to manage. Several prerequisites are listed below, and one of them is we will be […]

    Read more


  • Create A “Hello World” SpreadSheet Using Google Sheets API PHP Client

    Create A “Hello World” SpreadSheet Using Google Sheets API PHP Client

    Another most common use of the Google Sheets API is to write SpreadSheet cell values. Since we have Created A Blank Spreadsheet Using Google Sheets API PHP Client Library from our previous tutorial, we can use that blank spreadsheet to write a “Hello World!” example data to a particular cell. Overall, this is the next […]

    Read more


  • Create A Blank SpreadSheet Using Google Sheets API PHP Client Library

    The next thing to do after all the set up and configuration, from Creating a Google Cloud Project up to Obtaining Google API Access Token Through Command Line Using PHP, is to finally test the Google Sheets API. And I know it’s getting a little more exciting from here. Let’s create our first blank Google […]

    Read more


  • Obtain Google API Access Token Through Command Line Using PHP

    To test your Google Credential OAuth Client ID, you can quickly make a php script to see if you can obtain an access token. You will be using this access token to call Google Sheets API to send request to edit, create, and delete Google Sheets spreadsheets. Requirements: Create A Google Cloud Project Create A […]

    Read more


  • Install The Google Client Library Specifying Google Sheets

    We will only be needing the Online Spreadsheet Editor of Google, otherwise known as Google Sheets, for the examples we will be making. Thus, we will not be including the other Google API services, which is about 200+ all in all. And we will be using composer to install the Google Client Library. Overview of […]

    Read more


Featured Tutorials