Last active
December 18, 2015 10:59
-
-
Save abudayah/5772947 to your computer and use it in GitHub Desktop.
Get foursquare venue id by URL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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