Re: multideminsional associative arrays
| From: | Zipkid | Date: | Mon, 09 Oct 2000 21:01:29 +0000 |
| Subject: | Re: multideminsional associative arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19240@lists.php.net to get a copy of this message | ||
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.....
myfunction( $fruits["apple"] );
function myfunction( $afruit ){
foreach( $afruit as $key => $property ){
print( $key . " : " . $property );
}
}
--
Stefan - Zipkid - Goethals
YourNet - Open source web design & Site management.
http://www.yournet.be
mailto:stefan@yournet.be