Skip to content

Instantly share code, notes, and snippets.

@wallacemaxters
Created August 23, 2018 18:37
Show Gist options
  • Save wallacemaxters/3149260f58e6a66daeccc0f730db03b1 to your computer and use it in GitHub Desktop.
Save wallacemaxters/3149260f58e6a66daeccc0f730db03b1 to your computer and use it in GitHub Desktop.
@wallacemaxters
Copy link
Author

Example:

foreach(range_limit(1, 55, 10) as $page) {
      printf('<a href="%s">%s</a>', $page, $page);
}

Result:

<a href="1">1</a>
<a href="2">2</a>
<a href="3">3</a>
<a href="4">4</a>
<a href="5">5</a>
<a href="6">6</a>
<a href="7">7</a>
<a href="8">8</a>
<a href="9">9</a>
<a href="10">10</a>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment