![]() |
$bbuserinfo[usergroupid] vs. $bbuserinfo['usergroupid']
Is there a difference? My meager PHP knowledge would assume they are both the same :).
|
I have found both being used in PHP files, but only $bbuserinfo[usergroupid] being used within the templates. I believe they work almost the same, but don't quote me. :)
|
You got some reading to do. :)
Why is $foo[bar] wrong? Velocd: It is right in templates, because templates are evaluated as strings, and you can't use $foo['bar'] in strings (unless you surround it with { and }, i.e {$foo['bar']}). Constants are also not parsed inside strings, so even if they make bar a constant (for the sole purpose of killing time), "$foo[bar]" will work just fine. |
Hehe... thanks :).
I learned to do $foo["bar"] and use {foo["bar"]} within strings from my PHP book, but then I noticed that it's sometimes used with just $foo[bar] in the vbulletin source code. Well, now I know :p. |
vB3 should have $foo['bar'] instead of $foo[bar], except for templates.
|
All times are GMT. The time now is 08:04 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|