Jeff Taylor wrote:
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)
Hell no,
there's a difference between:
$array[$me] and array($me);
The first results in:
$array[$me] = null;
the other results in
$array[0] = $me;
Note that in the 2nd one you assign $me as the first value of the array,
and in the 1st one you assign $me to be the first index/key of the array
(with a null value).
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
Then use $name as being an actual NAME (aka "string") instead of the
entire `toon` you are talking about (aka "object").
- tul
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php