-2

I am using the telegram bot to send some text with external link in it as a button. i have tried with following code bot i dont know the Json value to send. please, can anybody can help me?

$sendMsg = file_get_contents($boturl."/sendmessage?chat_id=".$chat_id."&text=".$c."&parse_mode=HTML&reply_markup=json_encode("?????")"); 

please help me

1 Answers1

0

Try this

file_get_contents($boturl.'/sendmessage?chat_id='.$chat_id.'&text='.$c.'&reply_markup={"inline_keyboard":[[{"text":"Press here to open URL","url":"https://example.com"}]]}');
newsha
  • 1,288
  • 1
  • 10
  • 13