Hi everyone I'm having a little struggle on this one and would appreciate some help.
In PHP variable variables can easily be defined like this
$a = "myVar";
$$a = "some Text";
print $myVar; //you get "some Text"
Now, how do I do that in a OOP enviroment? I tried this:
$a = "myVar";
$myObject->$a = "some Text"; //I must be doing something wrong here
print $myObject->myVar; //because this is not working as expected
I also tried $myObject->{$a} = "some Text"
but it's not working either. So I must be very mistaken somewhere.
Thanks for any help!