user badges

Get the users badges.

$api_badges = 'https:api.foursquare.comv2usersselfbadges?oauth_token=' . $token;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_badges);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$foursquare_badges_base = curl_exec($ch);
curl_close($ch);

$foursquare_badges = json_decode($foursquare_badges_base, true); 


foreach ($foursquare_badges['response']['badges'] as $badge) 
{
	
	$badgeId = $badge['badgeId'];
	$name = $badge['name'];
	$description = $badge['description'];
	$badgeimg = $badge['image'];
	
	$prefix = $badgeimg['prefix'];
	$size = '114';
	$imgend = $badgeimg['name'];
	$imgurl = $prefix . $size . $imgend;
}