Posted by Alan Little on 05/17/06 23:18
Carved in mystic runes upon the very living rock, the last words of Rik
of comp.lang.php make plain:
> Alan Little wrote:
>> class example {
>> var $Stage;
>>
>> function example() {
>> $this->Stage = 'init';
>>
>> $x = ???????;
>>
>> echo $$x;
>> }
>> }
>>
>> What do I put in $x so that $$x gives me "init"? 'Stage' doesn't work,
>> nor does 'this->Stage'.
>
> Why use the $$ syntax?
>
> <?php
>
> class test{
> var $string;
> function text(){
> $this->string = "This works";
> $check = 'string';
> echo $this->$check;
Ah, yes that works. Thank you.
--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Navigation:
[Reply to this message]
|