$json='{
"status": true,
"data": {
"code": "44882S",
"quantity": 124740,
"amount": 124740,
"date": "2020-01-15"
}
}';
and I've made the code and the code doesn't work
$get = json_decode($json, true);
foreach ($get->data as $key) {
$code = $key->code;
$quantity = $key->quantity;
$amount = $key->amount;
$date = $key->date;
}
Is there something wrong with my code?
dd($get)and see if get the data.dd()is from laravel and I'm not sure if he is using it. Useprint_r()instead.