Hi, I have content profile module enabled and i am using the following code to get address details in to another node.

$profile_node = content_profile_load('profile','1');
dprint_r($profile_node);

This gives me :

stdClass Object
(
[field_address_line_1] => Array
        (
            [0] => Array
                (
                    [value] => 16 The Green
                )

        )
)

I have tried
echo $node->field_address_line_1->0->value

but cant access the data

How would i access the value data ?

Comments

heine’s picture

First you access the member, then the element.

$profile_node->field_address_line_1[0]['value'];

See also http://www.php.net/manual/en/language.types.array.php

density’s picture

Wonderful, thank you for the quick reply