'Telegram bot keyboard resize_keyboard in php

I am working on a telegram bot using php, I want to resize my ReplyKeyboardMarkup button to fit each of the keyboards.

I want the first button to take the full width of the keyboard and the second and fourth button takes the middle then I want the last button to take the entire width at the bottom.

This is my code.

        $replyMarkup = array(
          'keyboard' => array(
              array("Get all foods", "Menu" "List", "Cancel")
          ),
          'resize_keyboard' => true
      );
      // checking if this user has already login in before
          $useit = json_encode($replyMarkup);
          $parameters = array(
              "chat_id" => $user_id,
              "parseMode" => "html",
              "text" => "Select country code",
              "reply_markup" => $useit
          );
        send("sendMessage", $parameters);

How can I resize each of my buttons using 'resize_keyboard' => true



Solution 1:[1]

you can make your keyboard structure with arrays for example:

$replyMarkup = array(
     'keyboard' => array(
          array("Get all foods"),
          array("Menu", "List"),
          array("Cancel")
     ),
     'resize_keyboard' => true
);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nabi