Re: multideminsional associative arrays
| From: | Joe Stump | Date: | Fri, 06 Oct 2000 21:39:59 +0000 |
| Subject: | Re: multideminsional associative arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18986@lists.php.net to get a copy of this message | ||
do this:
function spit_out_stuff($array){
while(list($key,$val) = each($array)){
echo $key.' ==> '.$val.'<br>';
}
}
// your array below here
spit_out_stuff($fruits['apple']);
--Joe
On Fri, Oct 06, 2000 at 05:36:37PM -0400, Rebecca wrote:
> anyone know where i can find information about passing one deminsion of a multideminsional
> array to a function?
>
> so say my array looks like this:
>
>
> $fruits = array(
> "apple" => array(
> "color" => "red",
> "size" => "3oz"
> ),
> "Banana" => array(
> "color" => "yellow",
> "size" => "4oz"
> ),
> "Grapefruit" => array(
> "color" => "orange",
> "size" => "5oz"
> )
> );
>
> i want to pass the "apple" array to a function.....
/*****************************\
* Joe Stump *
* www.Care2.com *
* Office: 650.328.0198 *
* Extension: 122 *
\*****************************/
http://www.miester.org/Joe/Stump/Joe_Stump_resume.html
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GB/E/IT d- s++:++ a? C++++ UL++$ P+ L+++$ E----! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D(++++) G++@ e+@ h@ r+! z(+++++**)!
------END GEEK CODE BLOCK------