Are you instantiating $this->test2 in the constructor?
i.e.
$this->test2 = array();
red <gr****@reenie.org> wrote in message news:<Ls******************@news.easynews.com>...
The example I gave made no sense so I'll try again.
within an object function, this code:
$test[]='test';
echo "$test[0]";
$this->test2[]='test2';
echo "$this->test2[0]\n";
produces this result:
test
Array[0]
Why do I get Array[0] instead of the value in Array[0] ?
This only seems to happen when the variable is part of an array in an
object. If, for example, I want to wrap an object's variable in single
quotes this doesn't work:
"'$this->test2[0]'"
I can put double quotes areound the single quotes:
"'".$this->test2[0]."'"
but in a long string this becomes very tedious:
"$this->name=['".$this->mbox[0]."','".$this->mbox[1]."',".$this->mbox[2]."];";
is there any way to get "'$this->test2[0]'" to work ?
red