Forum Moderators: coopster
echo "some text here $this->parent_form->values[$this->name]";
But the object reference isn't interpolated, instead it prints:
"some text here Object->values[name_1]"
however this works:
$value = $this->parent_form->values[$this->name];
echo "some text here $value";
I'n not a OO php wiz or anything, so this could be a stupid question... why doesn't the firt example work?
echo "some text here {$this->parent_form->values[$this->name]}";
I always take my variables out of the string just to be sure. In this case, it isn't any nicer to have it in the string.
Good luck!
These either must be within brackets or taken out of the quotes.
More info [us2.php.net]