Hi,
This line:
is populating the array with a new element $arr[($ANS-1)] if it doesn't exist. See autovivification.$MMANS=$arr[($ANS-1)][3];
I would suggest validating your input and disallowing a value greater than the number of elements in your array.
Hope this helps!
In reply to Re: Count of element in array - autovivification
by 1nickt
in thread Count of element in array - Help
by g_speran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |