检索数组值

时间:2013-02-25 16:25:40

标签: php arrays

有关如何使用PHP从此阵列中检索email1 @ some.com,email2 @ some.com,email3 @ some.com,email4@some.com和email5@some.com的任何想法?

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
        )
)

由于

1 个答案:

答案 0 :(得分:2)

<?php
foreach ($array as $item) {
    $email = $item[0];
    // Do something with $email
}
?>