Consider the different values that $i will assume as the loop runs. Potentially just print out $i like:
print "Slot[$i]: $array[$i*2], port: $array[$i*2 + 1]\n"
In reply to Re: Accessing array elements
by Corion
in thread Accessing array elements
by Ravendark
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |