Hello to all! It is necessary to make the TOP-10 of the most repetitive words (more than 3 letters) from the file input.txt and put them in the outbox.txt file after sorting.
The input.txt file contains the words line by line.
I started to do it, but I cannot do the sorting.
Here is my beginning:
$f_arr = file( "input.txt" ); $new = 0; for ($i = 0; $i < sizeof($f_arr); $i++) { if(strlen($f_arr[$i])-2 > 3) { $arr[$new] = $f_arr[$i]; $new = $new +1; } } //сортировка foreach($arr as $a) { echo $a . '<br />'; }
Thank you in advance.