"data": {
"id": 9,
"name": "tala",
"role": "Student",
"email": "tala@gmail.com",
"students": [
{
"id": 1,
"name": "tala",
"type": "Master_Degree",
"year": "third",
"Semester": null,
"specializations": "جراحة",
}
]
},
我曾经通过这样做来接收电子邮件:
响应['数据']['电子邮件']
如何从响应['data']['student']中获取“类型”??
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
在您的
data对象中,学生是一个对象数组!可以添加这么多学生!
要访问学生属性,您必须循环到学生数组中。
$students = response["data"]["students"]; foreach($students as $student ) { //access to each student in your list // do what ever you want }