Skip to content

Instantly share code, notes, and snippets.

View tedkulp's full-sized avatar

Ted Kulp tedkulp

View GitHub Profile
<?php
if (!function_exists('getPageChooser')) {
function getPageChooser($pageLinks=array(), $activeIndexNumber=0, $previousText="Previous", $nextText="Next", $firstVisableNumber=1) {
// This function takes an array with links and makes a nice page chooser from it.
// The index of the array is 0 based, so is the activeIndexNumber.
// Make firstVisableNumber 0 if you want to see pagenumbers start with 0 (Why would you???).
$pagermenu = array();
if (!is_array($pageLinks)) return "";
$pageLinksCount = count($pageLinks);