I got a json data in return in my php script and this json data is stored in my variable. Now i would like to check the "price" for name "express" in php. Please guide me the way to extract the data in php.
$serviceTypesJSON = json_decode($rawBody, true);
{
"services": {
"service": [
{
"code": "INT_PARCEL_COR_OWN_PACKAGING",
"name": "Courier",
"price": "85.13",
"max_extra_cover": 5000,
"options": {
"option": [
{
"code": "INT_TRACKING",
"name": "Tracking"
},
{
"code": "INT_SMS_TRACK_ADVICE",
"name": "SMS track advice"
},
{
"code": "INT_EXTRA_COVER",
"name": "Extra Cover"
}
]
}
},
{
"code": "INT_PARCEL_EXP_OWN_PACKAGING",
"name": "Express",
"price": "40.13",
"max_extra_cover": 5000,
"options": {
"option": [
{
"code": "INT_TRACKING",
"name": "Tracking"
},
{
"code": "INT_SIGNATURE_ON_DELIVERY",
"name": "Signature on delivery"
},
{
"code": "INT_SMS_TRACK_ADVICE",
"name": "SMS track advice"
},
{
"code": "INT_EXTRA_COVER",
"name": "Extra Cover"
}
]
}
},
{
"code": "INT_PARCEL_STD_OWN_PACKAGING",
"name": "Standard",
"price": "31.40",
"max_extra_cover": 5000,
"options": {
"option": [
{
"code": "INT_TRACKING",
"name": "Tracking"
},
{
"code": "INT_EXTRA_COVER",
"name": "Extra Cover"
},
{
"code": "INT_SIGNATURE_ON_DELIVERY",
"name": "Signature on delivery"
},
{
"code": "INT_SMS_TRACK_ADVICE",
"name": "SMS track advice"
}
]
}
},
{
"code": "INT_PARCEL_AIR_OWN_PACKAGING",
"name": "Economy Air Parcels",
"price": "23.77",
"max_extra_cover": 500,
"options": {
"option": [
{
"code": "INT_EXTRA_COVER",
"name": "Extra Cover"
},
{
"code": "INT_SIGNATURE_ON_DELIVERY",
"name": "Signature on delivery"
}
]
}
}
]
}
}
Now how to extract the "name": "Express", "price": "40.13", from this variable? I would like to take the express, standard, Economy Air Parcels price. Please help me how to extract the exact data from this json mixed data