Welcome Guest, Not a member yet? Register   Sign In
Super-Noob question
#1

[eluser]taewoo[/eluser]
Sorry if this place is the wrong place to post but i'm a CI developer and i didn't know where to ask this... so apologies in advance.

Ok, so I never formally learned PHP... i just picked it up as I learned CI.

If i have a class and it has member "var_x"... I reference it by
Code:
$object->var_x;

But is there a way I can do this?

Code:
$field="var_x";
$object->{$field};

I remember seeing something like this in FreakAuth and i was blow away (i don't know why) but i can't seem to recall the correct method..


Messages In This Thread
Super-Noob question - by El Forum - 02-05-2009, 02:10 AM
Super-Noob question - by El Forum - 02-05-2009, 02:25 AM
Super-Noob question - by El Forum - 02-05-2009, 02:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB