Just had a chance to try out your latest revision – working like a charm.
After writing all that up and re-reading your post, I get what you’re saying now. Really, all you’re doing is retrieving two sets of items:
- ID of the manager
- IDs of all images in the specified group
Since ‘Host’ isn’t included in the following array call (where array_count_values is now located), it is only counting the values that it pulled from imageID that are members of the group. It then counts up how many of each imageID there is (should only be one) and sets the variable equal to that.
I also see what you’re saying about $array[0] not being an actual array but the output number now that I can see that you’re really only interested in counting imageIDs – not multiple items like I thought.
Thanks for the explanation & fix!