Skip to content

Instantly share code, notes, and snippets.

@brandon-beacher
Created November 9, 2018 21:20
Show Gist options
  • Save brandon-beacher/126268b0c3790e38d9f479ecfb2a74af to your computer and use it in GitHub Desktop.
Save brandon-beacher/126268b0c3790e38d9f479ecfb2a74af to your computer and use it in GitHub Desktop.
Link Headers in PHP
$link = new Link();
$link->hub('https://example.com/websub/hub');
$link->self('https://example.com/myself');
$link->next('https://example.com/myself?page=2');
$link->__toString();
// <https://example.com/websub/hub>; rel="hub", <https://example.com/myself>; rel="self", <https://example.com/myself?page=2>; rel="next"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment