I've inherited a content management system with few embedded comments. Can't think of a better way to learn php. :bemused:
So, on each page, a menu is created on the left side by querying all of the possible menu items, then querying all of the permissions of the user, stepping through the menu item array, and building a list of valid menu items for the user.
This is only done for admin users, and most of our admins have access to every menu item. However, the other day, I had a user who only needed access to the 1st and 4th menu item. However, when they logged in, they only saw the 1st item.
It turns out that there is a function which builds an indexed associative array $aMenu[$i][column name] as a result of the determination of valid menu items. After every check of menu items, the counter $i would be incremented automatically. So, when you had a user who would not be given a couple of items you would have (I think):
$aMenu[0][column name] etc. with contents
$aMenu[3][column name] etc. with contents
For sure, because they were created. Does creating $aMenu[3] force the creation of $aMenu[1 & 2]? The php doesn't crash when you are later accessing values in $aMenu, at least not visibly so, although it processes $aMenu[1], and then prints the html (without the data from MySQL) for one more menu item, then drops down to the end of the loop and continues on.
At any rate, I've fixed the problem, but I'd like to understand more about how PHP reacts.