H
Hello
Guest
Here is the first one:
$someFile = fopen("someData.txt", "r");
$nextItem = fgets($someFile);
while (!feof ($someFile))
{
list($value1, $value2) = split (":", $nextItem);
print ("<p>$value1 $value2</p>)";
$nextItem = fgets($someFile);
}
fclose ($someFile);
print ("<p>$value </p>);
Here is the second one:
$value = 0;
$someFile = fopen("someData.txt", "r");
$nextItem = fgets($someFile);
while (!feof ($someFile))
{
list($value1, $value2) = split (":", $nextItem);
$value = $value $value2;
$nextItem = fgets($someFile);
}
fclose ($someFile);
print ("<p>$value </p>);
Is the first one displays a file containing exactly two lines of data?
is the second one reads a file containing two values on each line and sums the second values on each line?
Can someone please confimr if this is what these PHP programs do? thanx!
$someFile = fopen("someData.txt", "r");
$nextItem = fgets($someFile);
while (!feof ($someFile))
{
list($value1, $value2) = split (":", $nextItem);
print ("<p>$value1 $value2</p>)";
$nextItem = fgets($someFile);
}
fclose ($someFile);
print ("<p>$value </p>);
Here is the second one:
$value = 0;
$someFile = fopen("someData.txt", "r");
$nextItem = fgets($someFile);
while (!feof ($someFile))
{
list($value1, $value2) = split (":", $nextItem);
$value = $value $value2;
$nextItem = fgets($someFile);
}
fclose ($someFile);
print ("<p>$value </p>);
Is the first one displays a file containing exactly two lines of data?
is the second one reads a file containing two values on each line and sums the second values on each line?
Can someone please confimr if this is what these PHP programs do? thanx!