get top tracks

This returns the xml for the data containing the users top tracks.

$key='key';
$secret='secret';
$music_token='token';

$toptracks_url='http:ws.audioscrobbler.com2.0?method=user.gettoptracks&user=jfrazelle&limit=5&api_key=' . $key;
$top_tracks = simplexml_load_file($toptracks_url);

foreach ($top_tracks->toptracks->track as $track) {
	$rank = $track->attributes()->rank;
	$name=$track->name;
	$playcount=$track->playcount;
	$url=$track->url;
	$artist=$track->artist->name;
	$image=$track->image[0];
	if ($rank=='1'){
		$max=$playcount;
	}
}