$url = 'https://api.telegram.org/bot'.$token.'/sendMessage'; $replyMarkup = array( 'force_reply' => true, ); $encodedMarkup = json_encode($replyMarkup); $data = array('chat_id' => $user_id,'text' => $messages,'reply_markup'=>$encodedMarkup); $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data), ) ); $context = stream_context_create($options); $update = @file_get_contents($url, false, $context);