Php Parse String Into Arraylist Sort Function In R