0

I got the value of array index. I actually need email or name from this array response

I dont know how to get the array index value - please help me.

This is my array response code:

Array
(
    [shop] => Array
        (
            [id] => 65279000815
            [name] => Alexa Development
            [email] => cherrydmay@gmail.com
            [domain] => alexa-development.myshopify.com
            [province] => Gujarat
            [country] => IN
           
            [zip] => 364001
            [city] => Bhavnagar
            [source] => global-ecommerce-enterprises
            [phone] => 
            [latitude] => 21.7581572
            [longitude] => 72.1447434
           
            [address2] => 
            [created_at] => 2022-07-11T12:05:25+05:30
            [updated_at] => 2023-01-27T16:18:06+05:30
            [country_code] => IN
            [country_name] => India
            [currency] => USD
            [customer_email] => cherrydmay@gmail.com
            [timezone] => (GMT+05:30) Asia/Calcutta
           
            [plan_display_name] => Developer Preview
            [plan_name] => partner_test
            [has_discounts] => 
            
            [enabled_presentment_currencies] => Array
                (
                    [0] => USD
                )

            [transactional_sms_disabled] => 
            [marketing_sms_consent_enabled_at_checkout] => 
        )
)
ADyson
  • 57,178
  • 14
  • 51
  • 63
janki
  • 1
  • 1
  • Let's say this data is in a variable called `$arr`. So `$email = $arr["shop"]["email"]; echo $email;` should output `cherrydmay@gmail.com`. Does that answer your question? The request was unclear - you ask about getting the name or email and the values, but then also ask about getting the keys. Get your terminology right, ask a clear question, and give examples of the expected output - see also [ask], for future reference. – ADyson Mar 09 '23 at 13:42
  • 1
    _Probably_ a duplicate of [How can I access an array/object?](https://stackoverflow.com/questions/30680938/how-can-i-access-an-array-object) – ADyson Mar 09 '23 at 13:42
  • thank you it will be worked – janki Mar 17 '23 at 05:45

0 Answers0