'250', 'BUNDLE_B' => '500', 'BUNDLE_C' => '1250', 'BUNDLE_D' => '2500', 'BUNDLE_E' => '3750', 'BUNDLE_F' => '5000' ); while ($days2 <= $days) { $dtemp = date(dny,mktime(0, 0, 0, date("n") , date("d")-$days2, date("y"))); $date[] = $dtemp; $days2++; $currentread = '../logs/' . $dtemp . '.txt'; if (file_exists($currentread)) { $writevar = fopen($currentread,'r'); $read = file($currentread); foreach($read as $wholething) { $newarray = explode('#',$wholething); if ($newarray[2] != 99) { $ubertemp = $newarray[1]; $referrals[] = "$newarray[2]#$ramt[$ubertemp]"; } } } else { //HERE'S WHERE IT DOES STUFF ONCE IT FINISHES CYCLING THROUGH THE LOGS. print_r($referrals); break; } } //THIS CREATES A MULTIDIMENSIONAL ARRAY WITH FORMAT: [1][REF#][REFAMT] foreach($referrals as $value) { $keyandvalue = explode('#',$value); $ref2[] = $keyandvalue; } //THIS WILL DISPLAY TOTAL REFAMOUNT $numPayouts = 0; foreach($ref2 as $key) { //print $key[1] . "\n"; $sum = $sum + $key[1]; $numPayouts++; } $totalref = "Total Referral Payouts: $sum.
Total Number Of Referral Payouts: $numPayouts."; return $totalref; } ?>