This question already has an answer here:
- How can I access an array/object? 4 answers
I have an array which I can't seem to access properly, been trying to echo the address. It's called $user
and here is the print_r for it:
Array(
[0] => stdClass Object
(
[id] => 1
[firstname] => Casper
[lastname] => *lastname*
[email] => someEmail
[username] => aUsername
[password] => *encrypted password*
[address] => myAddress
[address2] =>
[city] =>
[state] =>
[zipcode] => 1111
[join_date] => current timestamp
)
)
1
It's in codeigniter and so far I've tried:
echo $user['address'];
echo $user->address;
Both of them with no luck. Any help is greatly appriciated
</div>