Do you not have any control over how the data is submitted? If not, you could do something like...
$unique_id = array();
foreach($array as $key => $value)
if(substr($key, 0, 10) == 'unique_id_')
$unique_id[substr($key, 10)] = $value;
EDIT: Just to clarify, the above code would give you a new array, $unique_id, which should be a bit easier to work with, e.g.:
Array
(
[2] => 348
[1] => 347
)