function get_clan_data ($clan) {
/*
** @name get_clan_data
** @param $c STRING The Runehead identifier of the clan desired.
**
** Returns an array with the clan's total members and XP, and
** average combat level and total level.
** Created by Limetang.
*/
$source = get_page('http://runehead.com/clans/ml.php?clan=' . $clan);
if(strpos($source, "
Memberlist Not Found
") !== false)
return false;
else {
$stats = array();
$start = strpos($source, '') + 7;
$stats['Clan Name'] = substr($source, $start, strpos($source, 'Memberlist') - $start);
$start = strpos($source, '');
$source = substr($source, $start, strpos($source, '
') - $start);
preg_match_all("#(.+?): (.+?)#", $source, $tmp, PREG_SET_ORDER);
foreach($tmp as $entry)
$stats[$entry[1]] = $entry[2];
return $stats;
}
}