Monkuar Posted January 12, 2012 Share Posted January 12, 2012 if ($r['parent_id'] > 0) { $this->children[ $r['parent_id'] ][$r['id']] = $r; } else { $this->forums[ $r['id'] ] = $r; } what is this code doing? i don't get it how it uses the 2 variables in the " [ " " ] " 's ? weird? $r is a simple select * from a query.. i dont get the 2 variables with [] right next to each other? Quote Link to comment https://forums.phpfreaks.com/topic/254849-somone-explain-this-code/ Share on other sites More sharing options...
jcbones Posted January 12, 2012 Share Posted January 12, 2012 They are indexes in a multidimensional array. PHP arrays-manual Quote Link to comment https://forums.phpfreaks.com/topic/254849-somone-explain-this-code/#findComment-1306747 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.