ho risolto cosķ :

function wordcount($str)
{
return count(explode(" ",$str));
}
$parole_fullname = wordcount($fullname);