Re: classes - multidimensional arrays
| From: | Mukul Sabharwal | Date: | Fri, 27 Oct 2000 04:24:52 +0000 |
| Subject: | Re: classes - multidimensional arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-22261@lists.php.net to get a copy of this message | ||
Rebecca,
What's wrong in this, it works perfectly... if you
access
$transams->enhancements it will simply print 'Array'
you'll have to traverse through the keys and values!
Got it ?
--- Rebecca <rebecca@digitalpulp.com> wrote: > ok - so
what i meant was i want to use a
> multidimensional array:
>
> class car {
>
> var $enhancements;
>
> function init($x) {
> $this->enhancements = $x;
> }
> }
>
> $addons = array(
> "radio" => array (
> "price" =>
> 150,
> "cassete"
> => "No",
> "cd" =>
> "yes"
> ),
> "four_w_drive" => 1000,
> "leather" => array (
> "price"
> => 1200,
> "color"
> => "red",
>
> "stitching" => "blue"
> )
> );
>
> $transam = new car;
> $transam->init($addons);
>
=====
To Find Out More About Me : http://mukul.tsx.org/
__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf! It's FREE.
http://im.yahoo.com/