I have been following 2 ways to get data from an array..sometimes i use
$username= $data['username'];
$first_name= $data['first_name'];
and sometimes,
$username= $data->username;
$first_name= $data->first_name;
Anytime i have an array, i know 1 of them will work, and it works..
but i am unable to understand what is the difference between them, I am never sure which one to use.
I google it a lot but unable to find any explanation.
Kindly guide me
Thanks