0

Sorry it haven't occurred to me a better title :).

So I have two buttons that increase or decreases the decimal value of $page by 1, the problem is that I need to call external data whom paging system starts with 5 and adds 15 to change to next page, so $page's value don't apply.

The question is: how can I change $page's values from 1, 2, 3, 4... to 5, 20, 35, 50?

0

2 Answers 2

3

This should do it:

$start = 5;
$step = 15;
$result = $start + ($page-1) * $step;
Sign up to request clarification or add additional context in comments.

Comments

1

Use 5 + (n - 1) * 15 as page number, n = 1, 2, 3, ...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.