Simple and elegant way to do pagination in PHP