tags:

views:

51

answers:

2

Hi,

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?

+3  A: 

like:

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

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

look more in

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

Haim Evgi
@rayss Please read some documentation first?! We are not coders on demand :P @Haim you are more patient than me, great answer though :)
etbal
+1  A: 
$product_id = $your_array['products']['Product']['productId'];

$address_id = $your_array['addresses']['Address']['addressTypeID'];
Otar
thank you very much
rayss