Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save manticorp/5336106 to your computer and use it in GitHub Desktop.
Save manticorp/5336106 to your computer and use it in GitHub Desktop.
Preg match to get ASIN from amazon URL
$url = "http://www.amazon.co.uk/dp/B003YGQP6A";
preg_match('/\/([a-zA-Z0-9]{10})/',$url,$parsed);
$ASIN = $parsed[1];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment