Pagination class in PHP with an example