I have an API which is returning me response like this.
{
"logs": [
[
"2018-05-22 00:10:16",
"Billed"
]
],
"package": "superpremium",
"subdate": "2018-05-08 14:18:18",
"submedium": "CALL"
}
I'm trying to change into array so It can be easily accessible for me. For example.
$response['subdate']; // echo 2018-05-08 14:18:18
$response['submedium']; // echo CALL
$response['package']; // echo superpremium
and the logs one should be like
$response['logs'];
logs must be an array so I can use foreach
log to display all values of an array like 2018-05-22 00:10:16
or "Billed" etc
I have used below codes but returns empty screen.
json_decode($response, true);
json_decode($response);