On Tuesday 07 January 2003 01:12, Christopher J. Crane wrote:
> Ok here is what I did but it does not do anything.
> I verified that is opening the file ok and everything, but it shows
> nothing. It doesn't even produce an error. I am sure there is an easier way
> than looping twice, but this is how I have it for now.
>
> $Lines = array();
> $TempDir = "tempdata";
> $DataFromFile = file("$TempDir/$Dat.txt");
> while(list(,$oneline) = each($DataFromFile)) {
>  array_push($Lines, $oneline);
>  }
> $LineCount = 1;
> while(list(,$oneline) = each($DataFromFile)) {
>   $PriorLineCount = $LineCount - 1;
>   list($OctetsInB,$OctetsOutB,$TimeB) = split("|", $Lines[$LineCount]);
>   list($OctetsInA,$OctetsOutA,$TimeA) = split("|",
> $Lines[$PriorLineCount]); // After much help and work with Harry, this is
> the formula we came up with to show data rates over time.
>   // (((Counter_Now - Counter_Before) / (Time_Now - Time_Before(converted
> to seconds))) * 8)) / 1000 = kbits per hour
>   $kbitsout = ((($OctetsOutB - $OctetsOutA) / ($TimeB - $TimeA)) * 8 ) /
> 1000;
>   print "$kbitsout Kbits - $LineCount<br>\n";
>   $LineCount++;
>  }

echo() all the variables used and see what you get.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
I'm rated PG-34!!
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to