Help rtrim would not work whatever I do. I also tried to add whitespace after "," like it was on one of the topics i searched here
$this->items = array();
$xcount='(';
foreach ($items as $v) {
$this->items[$v['id']] = $v;
$xcount.=$v['id'].',';
};
rtrim($xcount, ",");
$xcount.=')';