luminous Posted March 22, 2010 Share Posted March 22, 2010 Just a quick one: I have a php class that has an array in it, how do i access the values of the array inside the object? I can't seem to get a result with either echo or print_r on: $this->$arrayName[0]; Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/196180-accessing-array-inside-object/ Share on other sites More sharing options...
Alex Posted March 22, 2010 Share Posted March 22, 2010 There's no $ in front of the variable name. Just: $this->arrayName[0]; Quote Link to comment https://forums.phpfreaks.com/topic/196180-accessing-array-inside-object/#findComment-1030223 Share on other sites More sharing options...
luminous Posted March 22, 2010 Author Share Posted March 22, 2010 thankyou! Quote Link to comment https://forums.phpfreaks.com/topic/196180-accessing-array-inside-object/#findComment-1030235 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.