well, why making PHP loop first once to build a separate array ?