Questi dati in che tipo di struttura dati li hai? In un array? Non ti è utile array_reverse()?