This question already has an answer here:
Need help here Please.
I have this type array from json_decode($items)
. The output array is like below :
Array
(
[0] => Array
(
[recipient_type] => EMAIL
[note] => For Sender
[receiver] => abc@gmail.com
[sender_item_id] => BB_000001
)
[1] => Array
(
[recipient_type] => EMAIL
[note] => For Sender
[receiver] => cde@gmail.com
[sender_item_id] => BB_000002
)
)
Then I used this code to get the data from the array :
foreach($items as $item) {
$data = array(
'RecipientType' => $item->RecipientType,
'Note' => $item->Note,
'Receiver' => $item->Receiver,
);
}
But i got error on $item->RecipeientType said :
Trying to get property of non-object
Seem that I cannot get The data from the array.
How should I get the data in the right way?
Thank You
</div>