#!/usr/bin/php 0) $word2count[$word] += $count; } // sort the words lexigraphically // // this set is NOT required, we just do it so that our // final output will look more like the official Hadoop // word count examples ksort($word2count); // write the results to STDOUT (standard output) foreach ($word2count as $word => $count) { echo $word, chr(9), $count, PHP_EOL; } ?>