$memberaddress - is there a way to use single elements from it?

Permalink 1 user found helpful
Hi

I am building a site for a society where all the members are supposed to be listed in a certain format.

I figured out how to import all the members but the format of the address attribute is causing me to go nuts.

How do I get a single element like address1 or ZIP from it?

When I call $memberaddress which works fine it just puts everything in one string...

Thanks for any pointers.

I was also unable to find the file that creates the dashboard user page so I could see how it is done there as the address shows in 2 lines with a </br> in between.

Thanks

shotrox
 
Mainio replied on at Permalink Best Answer Reply
Mainio
If I can remember correctly:
// Assuming your address attribute has key 'memberaddress'
$addr = $selectedUser->getAttribute('memberaddress');
echo $addr->address1;
echo $addr->address2;
echo $addr->city;
echo $addr->postal_code;
shotrox replied on at Permalink Reply
shotrox
Thank you! works like a charm!