Menu items start at 0, so it's probably better to initialize the choice to -1 or increment the menu items before storing them.
Also, notice there's a consistency in your code:
PHP Code:
switch ( item )
{
case 1 :
{
g_myarray[id] = 1
}
case 2 :
{
g_myarray[id] = 2
}
case 3 :
{
g_myarray[id] = 3
}
}
Notice how, on case 2, you set
g_myarray[id] to 2, etc. In this case, your code can be generalized to:
PHP Code:
g_myarray[id] = item
You can, of course, add extra checks like:
PHP Code:
if ( item > 0 && item < 6 )
{
g_myarray[id] = item
}
__________________