Posted by Dan R. on 07/17/07 16:40
I'm using the following to open and print values from a .dat file but
I can't figure out how to sort the results. I think I need to use
either the array_multisort() or krsort() functions. If so, how would I
do that?
<html>
<body>
<pre>
<?php
$fp = fopen("datfile.dat", r);
$count = 0;
while(!feof($fp))
{
$register = fgets($fp, 4);
$sales = fgets($fp, 5);
$register_array[$count] = $register;
$sales_array[$count] = $sales;
print "Register: $register_array[$count]<br>";
print "Sales: $sales_array[$count]<br>";
$count = $count + 1;
}
?>
</pre>
</body>
</html>
--
Thanks,
Dan
[Back to original message]
|