Right.
http://us2.php.net/manual/en/function.implode.php
Edit: And by the way, I happened to have a reason to be looking at includes/class_dm_user.php this morning, and if you look at function pre_save() in that file, you can see what's done if any usergroups are changed. It looks like the only things to worry about are if you add or delete the "displaygroup", or if the changes would affect the user's ranks.