<?php

preg_match_all('/\w+/', file_get_contents($argv[1]), $words);
$frecuency = array_count_values($words[0]);
arsort($frecuency);

echo ;
$i = 1;
foreach ($frecuency as $word => $count) {
    echo $i .  . $word .  . $count . ;
    if ($i >= 10) {
        break;
    }
    $i++;
}