Re: Troubles from the newb again

From: Date: Sat, 10 Mar 2007 05:51:30 +0000
Subject: Re: Troubles from the newb again
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-250190@lists.php.net to get a copy of this message
Yeah I have, but what I dont understand is that the value of $name is an object, and was accepted in the original array as the index: the original array was: $me = new Toon(xxxx,xxx,xxx,xxxx,xxx,etc,etc,etc) $him = new Toon(xxx,xxxxxx,xxxxx,etc,etc,etc,etc) .... $array=array($me,$him) So this new array, I want to isolate those toons still alive: if alive then add toon to new array Is this possible in anyway? The reason why I dont want it to put it in a value: foreach ($newarray as $name) { if (in_array($name,$characters)) { $newarray[$name] = 1; } else { $newarray[$name] = 2; } } Sorry for the spam everyone "Robert Cummings" <robert@interjinn.com> wrote in message news:1173502882.5388.85.camel@blobule... > On Sat, 2007-03-10 at 15:31 +1030, Jeff Taylor wrote: > > Hey everyone, > > Newb back again - Im trying to populate my arrays, but getting this error > > again: > > Warning: Illegal offset type in > > This usually means that you are using a non-scalar value as an index. > Use var_dump( $array ) to see what's in there. You will probably find > one of the following: an array, and object, or the null value. > > Cheers, > Rob. > -- > .------------------------------------------------------------. > | InterJinn Application Framework - http://www.interjinn.com | > :------------------------------------------------------------: > | An application and templating framework for PHP. Boasting | > | a powerful, scalable system for accessing system services | > | such as forms, properties, sessions, and caches. InterJinn | > | also provides an extremely flexible architecture for | > | creating re-usable components quickly and easily. | > `------------------------------------------------------------'

« previous php.general (#250190) next »