"; $words = explode(' ', $string); foreach($words AS $word) {   if(trim($word)) { // entfernt das Newline (\n) aus $string     $count_array[$word]++;   } } arsort($count_array); foreach($count_array AS $word => $count) {   echo "Das Wort "".$word."" kommt ".         $count." mal vor.
"4 } ?>