If I'm right, there shouldn't be any problem as far as your getPos() will actually return valid index for that array. Maybe you could use $_GET['var'] to get your value more easily?
Assuming:
-you have the following code in array.php
-you call it with your browser like: array.php?index=1
The following code (hopefully) does your trick: