arrays as object properties

From: Date: Mon, 23 Oct 2000 17:29:03 +0000
Subject: arrays as object properties
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-21861@lists.php.net to get a copy of this message
so if i have: class car { var $parts; function init($new_parts) { $this->parts = $new_parts; } } how can i make this work: $parts = array("radio","four_w_drive","mats","si"); $car = new car; //the following peice of code is the trouble......i can't seem to make an object property an array.... $car->init($parts);

« previous php.general (#21861) next »