//load pagination file to project include '../Pagination.php'; //sample arrray of 64 items $itemsList = array('as', 'bs', 'cs', 'ds', 'es', 'fs', 'gs', 'hs', 'is', 'js', 'ks', 'ls', 'ms', 'ns', 'os', 'ps', 'aq', 'bq', 'cq', 'dq', 'eq', 'fq', 'gq', 'hq', 'iq', 'jq', 'kq', 'lq', 'mq', 'nq', 'oq', 'pq', 'aw', 'bw', 'cw', 'dw', 'ew', 'fw', 'gw', 'hw', 'iw', 'jw', 'kw', 'lw', 'mw', 'nw', 'ow', 'pw', 'az', 'bz', 'cz', 'dz', 'ez', 'fz', 'gz', 'hz', 'iz', 'jz', 'kz', 'lz', 'mz', 'nz', 'oz', 'pz'); $page = filter_input(INPUT_GET, 'page'); //curent page. may be generated from form data. $size = '5'; //number of items per page. $pagesNumber = '10'; //total pages to show. //instanciate pagination class $pagination = new Pagination($itemsList, $page, $size, $pagesNumber); //set custom skip text $pagination->setSkip('<>'); //get pages count $pages = $pagination->getPages(); //get pages list $pagesList = $pagination->getPagesList(); //get items for the page $items = $pagination->getPageItemsList(); //get next and previous pages $next = $pagination->getNext(); $previous = $pagination->getPrevious(); ?> <html> <head> <title>Pagination example</title> </head> <body> <div> <!--print total page count -->