Skip to content

Instantly share code, notes, and snippets.

@ramigb

ramigb/gist:7854548

Last active Dec 30, 2015
Embed
What would you like to do?
Pagination - Get limit and offset
function page($page,$limit){
if($page == 0 ){
return 0;
}elseif ($page == 1){
return $limit;
}else{
if($limit == 1){
return $page * $limit;
}else{
return ($page * $limit) - $limit;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment