sublimenal
05-24-2004, 12:55 AM
]Hi guys great site you got here, im wondering if someone can give me a hand. im trying to set up stats for a game i play. i have a game that outputs stats to a file called stats.ini i want to take this data and put it in tables. i found out kinda how to do this but it takes everything! and i dont want everything i just want like the top 10 or something. here is the code im using now
<html>
<body bgcolor="#000000" text="#FF8a00">
<?
// file() makes an array of each line of the file
$players = file("/home/council/public_html/stats/stats.ini");
echo "<table border=1 cellspacing=1 cellpadding=1>";
// loop through each line
foreach($players as $each){
// explode line into an array
$line = explode(",",$each);
echo "<tr><td>".$line[0]."</td><td>".$line[1]."</td><td>".$line[2]."</td></tr>\n";
}
echo "</table>";
and it displays this
http://www.councilofvalhalla.com/stats/test.php
here is the data file
http://www.councilofvalhalla.com/stats/
if there is anyone that could help me it would be most appreciated.thanks
<html>
<body bgcolor="#000000" text="#FF8a00">
<?
// file() makes an array of each line of the file
$players = file("/home/council/public_html/stats/stats.ini");
echo "<table border=1 cellspacing=1 cellpadding=1>";
// loop through each line
foreach($players as $each){
// explode line into an array
$line = explode(",",$each);
echo "<tr><td>".$line[0]."</td><td>".$line[1]."</td><td>".$line[2]."</td></tr>\n";
}
echo "</table>";
and it displays this
http://www.councilofvalhalla.com/stats/test.php
here is the data file
http://www.councilofvalhalla.com/stats/
if there is anyone that could help me it would be most appreciated.thanks