Is it possible to count how many ids in a comma separated string?
$str = 12,3434,2323
Well that's not a string (or proper syntax at all), but if it were, you could probably do a [man]substr_count/man on the number of commas in the string and add one if the string isn't empty (otherwise don't add one - empty string means 0 id's).