3
I have the following problem, after making a array
`push, I want to return the amount of repetition of a term for this:
$key = str_replace(array(',','.','https','/','#','!','@','&','?','\\',':','\'','”','(',')', 'ª','º','1','2','3','4','5','6','7','8','9','0','“','"','','','','-','','','❤','','','','','k','','',''), ' ', strtolower($key));
$wreply = split(' ',$key);
foreach ($wreply as $wkr)
{
if (strlen($wkr) > 3) {array_push($words, $wkr);}
}
$contagem = array_count_values($words);
this code gives me the word and the amount that was repeated
Example:
a => 5
I want to order it by its value, I used the rsort
thus:
$sort = rsort($contagem);
foreach ($sort as $key => $value)
{
echo "$key => $value,";
}