note 23406 deleted from language.oop by didou
| From: | didou@php.net | Date: | Sun, 07 Dec 2003 02:38:26 +0000 |
| Subject: | note 23406 deleted from language.oop by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-61544@lists.php.net to get a copy of this message | ||
Note Submitter: kpower@ardencompanies.com
----
To create an array of objects, try the following:
class Test{
function Test($temp){
$this->a = $temp;
}
function print_a(){
echo $this->a;
}
}
$myObj = array();
for($i = 0; $i < 10; $i++)
$myObj[] = new Test($i);
$myObj[9]->print_a();
Granted there are many ways to create you array. This is just a quick example.