(.*?)<\/\\1>/s';
preg_match_all($reg_exp, $text, $match);
foreach ($match[1] as $key=>$val)
{
if ( preg_match($reg_exp, $match[2][$key]) )
{
$array[$val][] = xml2array($match[2][$key]);
}
else
{
$array[$val] = $match[2][$key];
}
}
return $array;
}
// ENTER URL FOR PLAYERINFORMATIONS HERE
$url = "http://travian.ping-timeout.de/travissimo/travissimo.php?uid=1&domain=welt6.travian.de";
$xmlarray = xml2array(file_get_contents($url));
// get userinfos
$playerinfos = $xmlarray['stats']['0']['spielerinfos']['0'];
echo $playerinfos['userid']."
";
echo $playerinfos['username']."
";
echo $playerinfos['volk']."
";
echo $playerinfos['allianzID']."
";
echo $playerinfos['allianz']."
";
echo $playerinfos['welt']."
Historie:
";
// user-statistics day 1
$day1 = $xmlarray['stats']['0']['historie']['0']['DBInfo']['0'];
echo $day1['datum']."
";
echo $day1['rang']."
";
echo $day1['doerfer']."
";
echo $day1['einwohner']."
";
// user-statistics day 2
$day2 = $xmlarray['stats']['0']['historie']['0']['DBInfo']['1'];
echo $day2['datum']."
";
echo $day2['rang']."
";
echo $day2['doerfer']."
";
echo $day2['einwohner']."
";
// user-statistics day 3
$day3 = $xmlarray['stats']['0']['historie']['0']['DBInfo']['2'];
echo $day3['datum']."
";
echo $day3['rang']."
";
echo $day3['doerfer']."
";
echo $day3['einwohner']."
";
// user-statistics day 4
$day4 = $xmlarray['stats']['0']['historie']['0']['DBInfo']['3'];
echo $day4['datum']."
";
echo $day4['rang']."
";
echo $day4['doerfer']."
";
echo $day4['einwohner']."
";
// user-statistics day 5
$day5 = $xmlarray['stats']['0']['historie']['0']['DBInfo']['4'];
echo $day5['datum']."
";
echo $day5['rang']."
";
echo $day5['doerfer']."
";
echo $day5['einwohner']."
";
// user-statistics day 6
$day6 = $xmlarray['stats']['0']['historie']['0']['DBInfo']['5'];
echo $day6['datum']."
";
echo $day6['rang']."
";
echo $day6['doerfer']."
";
echo $day6['einwohner']."
";
// user-statistics day 7
$day7 = $xmlarray['stats']['0']['historie']['0']['DBInfo']['6'];
echo $day7['datum']."
";
echo $day7['rang']."
";
echo $day7['doerfer']."
";
echo $day7['einwohner']."
";
// link to statistics and other informations
$informations = $xmlarray['stats']['0'];
echo $informations['statslink']."
";
echo $informations['calc']."
";
echo $informations['source']."
";
echo $informations['load']."
";
echo $informations['info']."
";
echo $informations['announce-error']."
";
?>