Monday, May 23, 2011

Php Code: PHP RuneScape stat function

you use it like this:

$variable = getStats("RussellReal");

and you will get a two dimensional array.


$aspect would be "Level" or "Exp" or "Rank"

so for example: $variable["Strength"]["Level"]; will return 89, which is RussellReals Strength Level :P

not really for looping through the values, unless you use foreachs like so:

foreach ($variable as $skill => $v) {
$line = $skill;
foreach ($variable[$skill] as $aspect => $data) {
$line .= " ".$aspect.": ".$data;
echo $line."\n";
will print a readable version of the multidimensional array. :)
will return "false" if the username doesn't exist. and somewhere in the aspects of the second dimension of the arrays will be Not Ranked. for whichever skill the user isn't ranked in. Enjoy :)

No comments:

Post a Comment