$db_old_groups = CIBlockElement::GetElementGroups($ELEMENT_ID, true); while($ar_group = $db_old_groups->Fetch()) echo $ar_group["ID"]." ";