- array_values: documentation ( source)
<?php
$alluploads = array(':attachment2' => "attachment2");
$alluploads = array_values($alluploads);
for($i=0;$i<count($alluploads);$i++){
Echo "key: " . $i . " Has value: ". $alluploads[$i] ."\n";
}