第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

列出 JSON 響應(yīng) PHP 中的值

列出 JSON 響應(yīng) PHP 中的值

PHP
明月笑刀無情 2021-08-28 10:30:21
我目前正在使用 Amazon AWS SNS 向客戶發(fā)送 SMS。我想簡單地顯示一個下拉菜單,topicArn每個選項都作為每個選項。我從我收到的回復(fù)中嘗試了以下內(nèi)容,var_dump($topics);但它不起作用。<div class="form-group">                <label for="exampleFormControlSelect1">Select list</label>                <select class="form-control" name="selectList" id="selectList">                   <?php                    $topics = $sns->listTopics();                    $test = $topics->get('Topics');                     foreach($test['TopicArn'] as $topicArns)                     {                          echo '<option>'.$topicArns.'</option>';                     }                    ?>                </select>              </div>回復(fù):object(Aws\Result)#109(2){  [    "data": "Aws\Result": private  ]=>array(2){    [      "Topics"    ]=>array(4){      [        0      ]=>array(1){        [          "TopicArn"        ]=>string(50)"arn:aws:sns:eu-west-1:547872464065:Custoddmers-Optin"      }[        1      ]=>array(1){        [          "TopicArn"        ]=>string(42)"arn:aws:sns:eu-west-1:547872464065:Testing"      }[        2      ]=>array(1){        [          "TopicArn"        ]=>string(55)"arn:aws:sns:eu-west-1:547872464065:test19-06-2019_02-19"      }[        3      ]=>array(1){        [          "TopicArn"        ]=>string(57)"arn:aws:sns:eu-west-1:547872464065:tester19-06-2019_02-17"      }    }[      "@metadata"    ]=>array(4){      [        "statusCode"      ]=>int(200)[        "effectiveUri"      ]=>string(35)"https://sns.eu-west-1.amazonaws.com"[        "headers"      ]=>array(4){        [          "x-amzn-requestid"        ]=>string(36)"92f435gd-8fd5-5c0e-ad5hd-bhb74hkd74c66d"[          "content-type"        ]=>string(8)"text/xml"[          "content-length"        ]=>string(3)"717"[          "date"        ]=>string(29)"Wed, 19 Jun 2019 01:53:14 GMT"      }[        "transferStats"      ]=>array(1){        [          "http"        ]=>array(1){          [            0          ]=>array(0){          }        }      }    }  }
查看完整描述

1 回答

?
Qyouu

TA貢獻1786條經(jīng)驗 獲得超11個贊

這個怎么樣?


foreach($test['Topics'] as $topic)

{

 echo '<option>'.$topic['TopicArn'].'</option>';

}


查看完整回答
反對 回復(fù) 2021-08-28
  • 1 回答
  • 0 關(guān)注
  • 147 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號