亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

如何使用 Flutter、Laravel 和 PHP 存取 API 回應(yīng)中「students」數(shù)組中的「type」屬性?
P粉744831602
P粉744831602 2024-04-04 19:25:13
0
1
676

"data": {
    "id": 9,
    "name": "tala",
    "role": "Student",
    "email": "tala@gmail.com",
    "students": [
        {
            "id": 1,
            "name": "tala",
            "type": "Master_Degree",
            "year": "third",
            "Semester": null,
            "specializations": "?????",
            

        }
    ]
},

我曾經(jīng)透過這樣做來接收電子郵件: 回應(yīng)['資料']['電子郵件']

如何從回應(yīng)['data']['student']中取得「類型」? ?

P粉744831602
P粉744831602

全部回覆(1)
P粉311089279

在您的data物件中,學(xué)生是一個物件陣列!

可以增加這麼多學(xué)生!

要存取學(xué)生屬性,您必須循環(huán)到學(xué)生陣列中。

$students = response["data"]["students"];

foreach($students as $student ) {
  //access to each student in your list
  // do what ever you want
}
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板