""JJeffman"" <[EMAIL PROTECTED]> wrote in message
> I've already made an object which had a property that was an array. Now I
> need to have an array that can hold objects as its elements is It possible
> I didn't get it the expression array[$i]->Object gave me syntax error. Any
> tips ?

$object1 = new someClass;
$object2 = new someClass;

$array = array();

$array[] = $object1;
$array[] = $object2;

The $array now contains copies of the two objects.

You can fill more in like this:

$array[] = new someClass;

Access the objects like this:



PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to