PHP code example of maatify / google-sheet
1. Go to this page and download the library: Download maatify/google-sheet library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
maatify / google-sheet example snippets
namespace GoogleSheet;
use Maatify\GoogleSheet\SheetHandler;
class GSheet extends SheetHandler
{
protected string $credentials_file = __DIR__ . 'Json credintals location',
$spread_sheet_Id = 'sheet id 1uxGes9CR1mvdshgsdfhg',
$spread_sheet_range = 'sheet!A:Z';
private static self $instance;
public static function obj(): self
{
if(empty(self::$instance))
{
self::$instance = new self();
}
return self::$instance;
}
}
GoogleSheet\GSheet::obj()->ReadAll();
GoogleSheet\GSheet::obj()->WriteRow();