"data": {
"id": 9,
"name": "tala",
"role": "Student",
"email": "tala@gmail.com",
"students": [
{
"id": 1,
"name": "tala",
"type": "Master_Degree",
"year": "third",
"Semester": null,
"specializations": "جراحة",
}
]
},
I used to receive emails by doing this:
Response['data']['email']
How to get "type" from response['data']['student']? ?
In your
dataobject, students is an array of objects!So many students can be added!
To access the student attribute, you must loop into the student array.
$students = response["data"]["students"]; foreach($students as $student ) { //access to each student in your list // do what ever you want }