<?php
//Monta um array igual ao da pergunta
$valores = array("125", "148", "157", "169", "185"); for($i=0; $i<5; $i++){
$obj = new stdClass();
$obj->ID = $valores[$i];
$rows[] = $obj;
}
$all_ids = array_map(function($item){ return $item->ID; }, $rows);
PD9waHAKCgkvL01vbnRhIHVtIGFycmF5IGlndWFsIGFvIGRhIHBlcmd1bnRhCgkkdmFsb3JlcyA9IGFycmF5KCIxMjUiLCAiMTQ4IiwgIjE1NyIsICIxNjkiLCAiMTg1Iik7Cglmb3IoJGk9MDsgJGk8NTsgJGkrKyl7CgkJJG9iaiA9IG5ldyBzdGRDbGFzcygpOwoJCSRvYmotPklEID0gJHZhbG9yZXNbJGldOwoJCSRyb3dzW10gPSAkb2JqOwoJfQogICAKICAgJGFsbF9pZHMgID0gIGFycmF5X21hcChmdW5jdGlvbigkaXRlbSl7IHJldHVybiAkaXRlbS0+SUQ7IH0sICRyb3dzKTsKICAgZWNobyBpbXBsb2RlKCcsJywgJGFsbF9pZHMpOw==