I just saw this syntax in an application that I am reading through:
$this->CI->{$this->user_table}->selectEmail()
I've never seen the ->{}
syntax before.
What does that do?
I just saw this syntax in an application that I am reading through:
$this->CI->{$this->user_table}->selectEmail()
I've never seen the ->{}
syntax before.
What does that do?
It lets php know you want to use the resulting value as a name. For instance if the value of $this->user_table
is users
it tries to access the property of $this->CI->users
, otherwise you would get an error trying to access it. This Might be helpful they are called 'Variable Variables' apparently.