function gasesteDublicate($text) {
$cuvinte = str_word_count($text, 1);
$frecventa = array();
foreach ($cuvinte as $cuvant) {
$cuvant = strtolower($cuvant);
if (isset($frecventa[$cuvant])) {
$frecventa[$cuvant]++;
} else {
$frecventa[$cuvant] = 1;
}
}
$dublicate = array_filter($frecventa, function ($count) {
return $count > 1;
});
$rezultat = array();
foreach ($dublicate as $cuvant => $aparitii) {
$rezultat[] = "$cuvant -> $aparitii";
}
return implode(", ", $rezultat);
}
Nu stiu de ce am facut asta dar...4fun