if ($line == 'Creatures') $allowed = $line_num + 50; if ($line == 'Your Auctions') $notallowed = $line_num + 10; foreach ($this->creatures as $critter => $details) { if (ereg("$critter ",$line) && $line_num > $allowed && $line_num > $notallowed) { echo "
" . $critter . " - {$no}
"; print_r($details); // Found this creature :D $crit = explode($critter . ' ',$line); $no = $crit[1]; $no = explode(' ',$no); $no = $no[0]; $attack = (($details['att']*($details['boost']+1)) ^2) * $no; $defence = (($details['def']*($details['boost']+1)) ^2) * 1.4 * $no; $table = "{$critter}{$no}{$attack}{$defence}"; } }