Darie Nicolae,
It would seem to me that you don't have an array of values after the
line "$xml = new SimpleXMLElement( $entry->getXML() )", you actually
have SimpleXMLElement object. It only prints like an array when using
print_r because that's the way PHP prints a SimpleXMLElement variable.
Another way of checking this is to use echo( var_dump( $xml ) );. That
prints the type and value of the variable.
Since you have a SimpleXMLElement object, you want to use the
functions at
http://us.php.net/manual/en/ref.simplexml.php to parse
the SimpleXMLElement object. The functions "getName", "attributes" and
"children" can be used to trace through the XML doc and extract the
relevant data.
You're at the point where the purpose of your program, and thus what
you do with the returned data, is likely to be very different from
mine. Now that you have the data stored in an object (and you know
there is contact data in there because it printed with print_r), you
don't really need the Google Contacts API to print the information.
There's plenty of documentation on
php.net, plus tons of tutorials
around the web, so give it a go.
Good luck,
Greg
On Mar 24, 4:25 pm, darie nicolae <
darie.nico...@gmail.com> wrote:
> Ok greg, i did as you said
>
> if i do print_r($xml) i get this :
>
> SimpleXMLElement Object ( [edited] => 2009-03-23T21:51:40.519Z [email]
> => SimpleXMLElement Object ( [@attributes] => Array ( [rel] =>
http://schemas.google.com/g/2005#other[address] =>
d...@dasda.com
> [primary] => true ) ) [groupMembershipInfo] => Array ( [0] =>
> SimpleXMLElement Object ( [@attributes] => Array ( [deleted] => false
> [href] =>
http://www.google.com/m8/feeds/groups/varzariu.nicolae%40gmail.com/ba...
> ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array
> ( [deleted] => false [href] =>
http://www.google.com/m8/feeds/groups/varzariu.nicolae%40gmail.com/ba...
> ) ) ) ) SimpleXMLElement Object ( [edited] => 2009-03-23T21:36:09.859Z
> [email] => SimpleXMLElement Object ( [@attributes] => Array ( [rel] =>
http://schemas.google.com/g/2005#other[address] =>
hai...@yahoo.com
> [primary] => true ) ) [groupMembershipInfo] => Array ( [0] =>
> SimpleXMLElement Object ( [@attributes] => Array ( [deleted] => false
> [href] =>
http://www.google.com/m8/feeds/groups/varzariu.nicolae%40gmail.com/ba...
> ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array
> ( [deleted] => false [href] =>
http://www.google.com/m8/feeds/groups/varzariu.nicolae%40gmail.com/ba...
> ...
>
> read more »