Skip to content

Instantly share code, notes, and snippets.

@relrod
Created May 19, 2009 21:50
Show Gist options
  • Save relrod/114445 to your computer and use it in GitHub Desktop.
Save relrod/114445 to your computer and use it in GitHub Desktop.
<?php
$source = file_get_contents("http://hiscore.runescape.com/index_lite.ws?player=pcon2009");
include "ranks.php"; // so we have $array.
// First, get each of them in an array. It's easy to do this using explode().
$list = explode("\n",$source); // Put each in an array
$l = array();
$i = 0;
foreach($list as $line){ // Iterate through the $list array.
$i++; // increase a variable so we have something to count by.
// This gets a little confusing...
// Every time we iterate through the $list array, we add
// an entry
$l[] = explode(",",$line);
$l[$i][3] = $array[$i];
}
foreach($l as $rows){ // I fail at naming variables ><
echo "Type: ".$rows[3]."\n";
echo "Rank: ".$rows[0]."\n";
echo "Level: ".$rows[1]."\n";
echo "XP: ".$rows[2]."\n";
echo "-------------------------\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment