I have an array
Array(1=>'test',9=>'test2',16=>'test3'... and so on);
how do I get the next array item by passing the key.
for example if i have key 9 then I should get test3 as result. if i have 1 then it should return 'test2' as result.
Edited to make it More clear
echo somefunction($array,9); //result should be 'test3'
function somefunction($array,$key)
{
return $array[$dont know what to use];
}