Telegram::buildInlineKeyboardButton PHP Method

buildInlineKeyboardButton() public method

\param $text String; Array of button rows, each represented by an Array of Strings \param $url String Optional. HTTP url to be opened when button is pressed \param $callback_data String Optional. Data to be sent in a callback query to the bot when button is pressed \param $switch_inline_query String Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted. \return the requested button as Array
public buildInlineKeyboardButton ( $text, $url = "", $callback_data = "", $switch_inline_query = "" )
    public function buildInlineKeyboardButton($text, $url = "", $callback_data = "", $switch_inline_query = "")
    {
        $replyMarkup = array('text' => $text);
        if ($url != "") {
            $replyMarkup['url'] = $url;
        } else {
            if ($callback_data != "") {
                $replyMarkup['callback_data'] = $callback_data;
            } else {
                if ($switch_inline_query != "") {
                    $replyMarkup['switch_inline_query'] = $switch_inline_query;
                }
            }
        }
        return $replyMarkup;
    }