#pagination Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
PHP Parse Link Header for Pagination
Parse the standard HTTP Link header (RFC 5988) into a relation → URL map. Lets you follow rel="next" pagination in APIs like GitHub without manually building URLs.
PHP Paginated Query Helper
Run a SELECT with LIMIT/OFFSET and also return the total row count, so you can render "Page 3 of 47" UIs. Single function, two round trips.
PHP Cursor-Based Pagination
Cursor (keyset) pagination is faster than OFFSET on large tables — and immune to dupes/skips when rows shift. Pass the last seen ID and direction; get the next page.
SQL Pagination with LIMIT / OFFSET
`LIMIT N OFFSET M` is universal — but degrades on deep pages (the DB still has to scan past M rows). Keyset (cursor) pagination is much faster for huge tables.
PHP Chunk Array With Preserved Keys
Slice an array into chunks of a given size while preserving the original keys in each chunk. Useful for paginating ordered datasets without losing the row IDs.