Display count of elements in multiselect

I’m trying to show the amount of elements selected from a multiselect field called pkgmembers. I tried to use pkgmembers()->count() but it just spits out a list of the selections rather than a number
I tried using pkgmembers()->split()->count() but that threw an error.

I feel theres a simple solution I am just overlooking.

If You use split, you’ll get a normal array, so You can simply use php’s count function.

$members = pkgmembers()->split();
$count = count($members);

echo $count;