RE: [PHP] Multiple Arrays
| From: | Boget, Chris | Date: | Tue, 01 Aug 2000 16:26:00 +0000 |
| Subject: | RE: [PHP] Multiple Arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-9472@lists.php.net to get a copy of this message | ||
> I'm rather new to php, just getting my head around arrays at
> the moment.
> When I use this code, I get a Parse error.
> This is the code:
> $marray = array(
> "marray" =>
> ("a"=>"orange","e"=>"apple","d"=>"pear"),
> "taste" =>
> ("z"=>"bitter","x"=>"nice","y"=>"yuck"),
> "color" =>
> ("j"=>"orange","k"=>"red","l"=>"yellow"),
> "size" => (1,2,3,4)
> );
You want:
$marray = array(
"marray" =>
array("a"=>"orange","e"=>"apple","d"=>"pear"),
"taste" =>
array("z"=>"bitter","x"=>"nice","y"=>"yuck"),
"color" =>
array("j"=>"orange","k"=>"red","l"=>"yellow"),
"size" => array(1,2,3,4)
);
HTH
Chris