-2

Any idea about how I can retrieve email1@some.com, email2@some.com, email3@some.com, email4@some.com and email5@some.com from this array using PHP?

Array
(
    [0] => SimpleXMLElement Object
        (
            [0] => email1@some.com
        )

    [1] => SimpleXMLElement Object
        (
            [0] => email2@some.com
        )

    [2] => SimpleXMLElement Object
        (
            [0] => email3@some.com
        )

    [3] => SimpleXMLElement Object
        (
            [0] => email4@some.com
        )

    [4] => SimpleXMLElement Object
        (
            [0] => email5@some.com
        )
)

Thanks

lomse
  • 4,045
  • 6
  • 47
  • 68

1 Answers1

2
<?php
foreach ($array as $item) {
    $email = $item[0];
    // Do something with $email
}
?>
DiMono
  • 3,308
  • 2
  • 19
  • 40
  • 1
    This actually showed me how to solve the issue. You failed to specify that I need to cast the simpleXML Object to a string. Thanks by the way. http://stackoverflow.com/questions/2867575/get-value-from-simplexmlelement-object – lomse Feb 25 '13 at 16:37