2011-08-06 91 views
0

如何訪問數組內的電子郵件值。訪問數組中的PHP數組

我需要通過電子郵件的價值$電子郵件可變

輸出:

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] => 
) 
+0

好像錯identation因爲沒有陣列的近ACCOUNTID(後 – RiaD

+0

看一看在http://php.net/manual/en/language.types.array.php學習如何訪問數組值 –

回答

2
$email=$arr['clientsdetails']['email'] 
+0

看起來像數組被稱爲'$ params' –

3
$email = $array['clientsdetails']['email']; 
+1

我認爲RiaD說得對。代碼沒有正確縮進。 –

+0

@Philippe Gerber這就是你讀得太快時會發生的事情: – Manhim