Reverse Words with php and ruby