0

How do i access the email value inside the array.

I need to pass the email value to $email variable

Output:

params Array (
    [accountid] => 
    [serviceid] => 
    [domain] => 
    [username] => 
    [password] => 
    [packageid] => 
    [pid] => 
    [serverid] => 
    [customfields] => Array
        (
            [Cusom Field] => 
        )

    [configoptions] => Array
        (
        )

    [type] => 
    [producttype] => 
    [moduletype] => 
    [configoption1] => 
    [configoption2] => 
    [configoption3] => 
    [configoption4] => 
    [configoption5] => 
    [configoption6] => 
    [configoption7] => 
    [configoption8] => 
    [configoption9] => 
    [configoption10] => 
    [configoption11] => 
    [configoption12] => 
    [configoption13] => 
    [configoption14] => 
    [configoption15] => 
    [configoption16] => 
    [configoption17] => 
    [configoption18] => 
    [configoption19] => 
    [configoption20] => 
    [configoption21] => 
    [configoption22] => 
    [configoption23] => 
    [configoption24] => 
    [clientsdetails] => Array
        (
            [userid] => 
            [id] => 
            [firstname] => 
            [lastname] => 
            [companyname] => 
            [email] => 
            [address1] => 
            [address2] => 
            [city] => 
            [state] => 
            [postcode] =>
            [country] => 
            [countryname] => 
            [phonenumber] => 
            [notes] => 
            [password] => 
            [currency] => 
            [cctype] => 
            [cclastfour] => 
            [securityqid] => 
            [securityqans] => 
            [groupid] => 
            [status] => 
            [credit] => 
            [taxexempt] => 
            [latefeeoveride] => 
            [overideduenotices] => 
            [language] => 
            [lastlogin] => 
            [customfields1] => 
            [customfields2] => 
            [customfields3] => 
            [customfields4] =>
            [customfields5] => 
            [customfields6] => 
            [billingcid] => 
        )

    [server] => 
    [serverip] => 
    [serverhostname] => 
    [serverusername] => 
    [serverpassword] => 
    [serveraccesshash] => 
    [serversecure] => 
)
2
  • seems like wrong identation near accountid because of no Array( after it Commented Aug 6, 2011 at 17:56
  • Have a look at php.net/manual/en/language.types.array.php to learn how to access array values. Commented Aug 6, 2011 at 17:56

2 Answers 2

3
$email = $array['clientsdetails']['email'];
Sign up to request clarification or add additional context in comments.

2 Comments

I think RiaD got it right. The code is not properly indented.
@Philippe Gerber That's what happens when you read too fast :|
2
 $email=$arr['clientsdetails']['email']

1 Comment

Looks like the array is called $params

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.