I have written this function for my telegram bot in PHP but it doesn't work:
if($text == "t"){
$keyboard = array(
"inline_keyboard" => array(
array(
array(
"text" => "My Button Text",
"callback_data" => "myCallbackData"
)
)
)
);
$key = array(
"keyboard" => $keyboard,
);
keyboard($chatId, "asadsd", $key);
}
function keyboard($chatID, $text, $t)
{
$t2 = $t;
$t3 = json_encode($t2);
api("sendMessage?chat_id=$chatId&text=$text&parse_mode=HTML&reply_markup=$t3");
}
It should work but it is not doing so.