Word frequency analysis implemented in PHP