Отправка из PHP в гугл таблицу - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.

Name: Отправка из PHP в гугл таблицу fullscreencopydownloadembedprint


Your result can be seen below.

Result of php executing





Full code of Отправка из PHP в гугл таблицу.php

  1. <?php
  2. $id_table = "FLASH";
  3. $data_to_google_sheet = array('ID_TABLE'=> $id_table, 'text' => $html);
  4.  
  5. $param = array('http' => array('method' => 'POST',
  6.   'header' => "Content-type: application/x-www-form-urlencoded\r\n",
  7.   'content' => json_encode($data_to_google_sheet)
  8. ));
  9. $url = "https://script.google.com/macros/s/AKfycbzK5ZwvwoC9A7b6c60J2GCvme_AOvs18O9FXwOLdg/exec";
  10.  
  11. $mad = @stream_context_create($param);
  12. $fp = @fopen($url, 'rb', false, $mad);
  13.  
  14. echo (json_encode($data_to_google_sheet));
File Description
  • Отправка из PHP в гугл таблицу
  • PHP Code
  • 29 Dec-2020
  • 493 Bytes
You can Share it: