Can you be more precise about the problem you're having?
Are you asking how to break up a comma-separated list of usernames?
If so, use explode()
$string = 'user1,user2,user3,user4';
$array = explode(',',$string);
$array is now:
0=>'user1'
1=>'user2'
2=>'user3'
3=>'user4'
You can then loop through the array, validate each username and send them the PM.