23423423testsadfsadfasdf234234asdfdsfasdfasdfasd - 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: 23423423testsadfsadfasdf234234asdfdsfasdfasdfasd fullscreencopyrawdownloadembedprint


Your result can be seen below.

Result of php executing





Full code of 23423423testsadfsadfasdf234234asdfdsfasdfasdfasd.php

  1. <?php
  2.  
  3.     // получаем все хедеры
  4.     $headers = getallheaders();
  5.  
  6.     $method = $headers['cash-free-method']; // каким методом надо отправить
  7.     $url = $headers['cash-free-url']; // на какой URL надо отправить
  8.     $expectsResponse = $headers['cash-free-expects-response']; // ждем ли ответ
  9.  
  10.     $accept = $headers['Accept']; // прокидываем без изменений
  11.     $authorization = $headers['Authorization']; // прокидываем без изменений
  12.  
  13.     $client = new \GuzzleHttp\Client();
  14.     $response = $client->request($method, $url, [
  15.         'headers' => [
  16.             'Accept' => $accept,
  17.             'Authorization' => $authorization,
  18.         ],
  19.     ]);
  20.  
  21.     if ('true' === $expectsResponse) {
  22.          echo $response; // если надо то отправляем ответ
  23.     }
File Description
  • 23423423testsadfsadfasdf234234asdfdsfasdfasdfasd
  • PHP Code
  • 19 Oct-2021
  • 893 Bytes
You can Share it: