为 Hangouts Webhook 构造 PHP 数组

Constructing PHP Array for Hangouts Webhook

我正在尝试使用 PHP 构建以下数组,以便我可以将卡片发送到 Google Hangouts Chat Webhook。

{
    "cards": [
        {
            "sections": [
                {
                    "widgets": [
                        {
                            "keyValue": {
                                "topLabel": "Order No.",
                                "content": "12345",
                                "contentMultiline": "false",
                                "bottomLabel": "Delayed",
                                "onClick": {
                                     "openLink": {
                                        "url": ""
                                     }
                                 },
                                "icon": "TRAIN",
                                "button": {
                                    "textButton": {
                                       "text": "VISIT WEBSITE",
                                       "onClick": {
                                           "openLink": {
                                                "url": ""
                                            }
                                        }
                                      }
                                 }
                             }
                        }
                    ]
                }
            ]
        }
    ]
}

这是我到达的地方,但似乎不起作用..

$card["cards"]["sections"]["widgets"]["keyValue"]["topLabel"] = "Issue No";
$card["cards"]["sections"]["widgets"]["keyValue"]["topLabel"] = $_GET["issueid"];
$card["cards"]["sections"]["widgets"]["keyValue"]["contentMultiline"] = false;

任何帮助都会很棒,只是简要概述如何在 PHP 中构造上述数组。

谢谢!

已解决。

$card["cards"]["sections"]["widgets"]["keyValue"]["topLabel"] = $_GET["issueid"];

这将覆盖我认为的上面的那个,我认为 ["topLabel"] 应该是第二个索引中的 ["content"] ??

谢谢@devpro