Sure. Put the string into an array and then count how many occurences.
$interests = explode(",", $_POST['interests']);
$total = count($interests);
explode will separate the textarea string into an array. You can then count how many elements are in the array and slap heads as needed!
Use the .split()
method in JS, like so:
var str = "My really long annoying tag, my tag, good tag, lol";
var tags = str.split(",");
for(var tag in tags) {
if(tags[tag].split(" ").length > 3) {
alert("HEY DUMMY, '" + tags[tag] + "' is too long!!");
}
}