Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
define('TOKEN','7768137200:AAHxzY8tnIxVkjHRFesildnx8NIFk5dtyjM');
function jsone($str){return empty($str)? '': json_encode($str,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT);}
function call(array $arr){
return file_get_contents(
'https://api.telegram.org/bot'.TOKEN.'/',
0,
stream_context_create([
'http'=>[
'follow_location'=>false,
'ignore_errors'=>true,
'timeout'=>2,
'header'=>'Content-Type: application/json',
'content'=>jsone($arr)
],
'ssl'=>[
'verify_peer'=>false,
'verify_peer_name'=>false
]
])
);
return '';
}
$S='zxc1';
var_dump(call([
'method'=>'sendMessage',
'chat_id'=>524481401,
'parse_mode'=>'MarkdownV2',
'text'=>'```json'.PHP_EOL.addcslashes($S,'\\`').PHP_EOL.'```',
]));