$xml=simplexml_load_string($lists) or die("Error: Cannot create object");
print_r($xml);
gives:
SimpleXMLElement Object (
[list] => Array (
[0] => SimpleXMLElement Object (
[@attributes] => Array (
[id] => 8
[name] => #1
[subscriber_count] => 210
[display_name] => Display name
)
)
[1] => SimpleXMLElement Object (
[@attributes] => Array (
[id] => 9
[name] => #2 No External Promotions
[subscriber_count] => 2242
[display_name] => Display name
)
)
[2] => SimpleXMLElement Object (
[@attributes] => Array (
[id] => 939036
[name] => #1 No Internal Promotions
[subscriber_count] => 3301
[display_name] => Display name
)
)
)
how do I use a foreach loop to extract 'id' and other info.