Try this :
class foo {
var $var1="hello";
var $var2="world";
}
...
...
$fooinstance = new foo;
$vartest=$fooinstance->var1;
echo ($vartest); // should be 'hello'
This should work, but i had no time to test this code.
See you later
Sean C. McCarthy <[EMAIL PROTECTED]> a écrit dans le message :
[EMAIL PROTECTED]
> Hi All,
>
> I was wondering if it is possible to access dinamically to the members
> of a class. I mean to access like:
>
> ----------------------
> class foo {
> var $bar;
> var $barbar;
> }
>
> ..
> ..
>
> $foo_instance = new foo;
> $somevar = $foo->$anothervar;
> -----------------------------
>
> I now this doesn't work, and have searched the manual and haven't found
> anything on it. I doubt it since this is more or less the work of the
> Arrays and not the way a class should behave. Anyway any ideas? thanks
> in advance.
>
> Sean C. McCarthy
> SCI, S.L. (www.sci-spain.com)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]