如何获取数组的值?

发布于 2024-09-28 14:14:19 字数 1079 浏览 2 评论 0原文

我想获取此数组中的productId和addressTypeID的值: 大批 (

[0] => Array
    (
        [entityId] => 7100122
        [orderId] => 110631
        [createDate] => 2010-10-19T05:40:00
        [lastUpdateDate] => 2010-10-19T05:40:00
        [deleted] => 
        [products] => Array
            (
                [Product] => Array
                    (
                        [productId] => 674976
                        [productCode] => 
                        [productDescription] => testtest
                        [units] => 3
                    )

            )

        [addresses] => Array
            (
                [Address] => Array
                    (
                        [addressTypeID] => 8
                        [addressLine1] => Cebu, Ceity
                        [city] => City
                        [zipcode] => 6000
                        [state] => cebu
                        [countryCode] => PH
                    )

            )

    )

)

如何获取它的值?

I want to get the value of productId and addressTypeID in this array:
Array
(

[0] => Array
    (
        [entityId] => 7100122
        [orderId] => 110631
        [createDate] => 2010-10-19T05:40:00
        [lastUpdateDate] => 2010-10-19T05:40:00
        [deleted] => 
        [products] => Array
            (
                [Product] => Array
                    (
                        [productId] => 674976
                        [productCode] => 
                        [productDescription] => testtest
                        [units] => 3
                    )

            )

        [addresses] => Array
            (
                [Address] => Array
                    (
                        [addressTypeID] => 8
                        [addressLine1] => Cebu, Ceity
                        [city] => City
                        [zipcode] => 6000
                        [state] => cebu
                        [countryCode] => PH
                    )

            )

    )

)

How can I get the value of it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

那一片橙海, 2024-10-05 14:14:19

例如:

$myarray[0]['products']['Product']['productId']

$myarray[0]['addresses']['Address']['addressTypeID']

http://php.net/manual/en/language中查看更多信息

。类型.array.php

like:

$myarray[0]['products']['Product']['productId']

$myarray[0]['addresses']['Address']['addressTypeID']

look more in

http://php.net/manual/en/language.types.array.php

愿得七秒忆 2024-10-05 14:14:19
$product_id = $your_array['products']['Product']['productId'];

$address_id = $your_array['addresses']['Address']['addressTypeID'];
$product_id = $your_array['products']['Product']['productId'];

$address_id = $your_array['addresses']['Address']['addressTypeID'];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文