Re: Associative Arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 6/19/2008 05:55 PM, VamVan wrote:
How to create an associative array of this kind in PHP?

 return array(
    12345 => array(
      'mail' => 'asdf@xxxxxxxx',
      'companyName' => 'Asdf Inc.',
    ),
    54321 => array(
      'mail' => 'asdf@xxxxxxxx',
      'companyName' => 'Asdfu Corp.',
    ),
  );


This is the right PHP syntax, except that you've got an extraneous comma before the closing parenthesis of each array that's going to throw a parse error.

Regards,

Paul
__________________________

Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux