Skip to content

Instantly share code, notes, and snippets.

@abudayah
Last active December 18, 2015 10:59
Show Gist options
  • Select an option

  • Save abudayah/5772947 to your computer and use it in GitHub Desktop.

Select an option

Save abudayah/5772947 to your computer and use it in GitHub Desktop.
Get foursquare venue id by URL.
<?php
$url = 'https://foursquare.com/v/snacks-express/50b46d6ae4b06572462ed863';
$purl = parse_url($url);
$path = explode("/", $purl['path']);
$name = str_replace("-"," ", ucwords($path[2]));
$foursquare_name = $name;
$foursquare_venue_id = $path[3];
echo 'Venue Name : ' . $foursquare_name; // Venue Name : Snacks Express
echo 'Foursquare venue id : ' . $foursquare_venue_id; // Foursquare venue id : 50b46d6ae4b06572462ed863
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment