How can you move an array pointer to a specific key?

Ohh, create an index as you go…


$MyArray = array('1' => 3,
               '2' => 5,
               '5' => 10,
               '6' => 11,
               '7' => 13,
               '10' => 15,
               '11' => 20,
               '12' => 21,
               '15' => 35,
               '18' => 50,
               '19' => 55);
$MyArrayIndex() = array();
$counter = 0;
foreach($MyArray as $key => $val) {
  if(array_search($key, $MyArrayIndex()) === false) { // make sure you use 3 to do identical match, not type juggling due to 0's
    array_push($MyArrayIndex, $key);
  } else {
   Throw New Exception();
}
  if($foo) {
    //my -5 value
    $minus5Val = $MyArray[$MyArrayIndex[$counter-5]];
  }
  $counter++;
}

This will now create a new array, much like what I was trying to do, but will be seperate. As you walk down the array and you need to reference