Skip to content

Instantly share code, notes, and snippets.

@matthewpizza
Last active February 10, 2017 18:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save matthewpizza/224909e51ea848445d3c to your computer and use it in GitHub Desktop.
Save matthewpizza/224909e51ea848445d3c to your computer and use it in GitHub Desktop.
@matthewpizza
Copy link
Author

For PHP biz where $href is a link that may or may not be an Amazon link:

preg_match('/http:\/\/(.*amazon\.com\/.*|.*amzn\.com\/.*)/i', $href, $matches);

Cool way to grab hrefs from HTML, the DOMDocument class.

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